summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-07-24 18:28:56 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-07-24 18:28:56 +0000
commit88a0d1ff032093f93233c6faacef2689a989c2bc (patch)
tree012e91a115ce140a2bb5a95e67c23ee6d43aa26d /src
parent28958e51ef1f5db825366b08c401442f6c0c93da (diff)
downloadmetacity-88a0d1ff032093f93233c6faacef2689a989c2bc.tar.gz
look for themes in ~/.themes/NAME/metacity-1/ and
2002-07-24 Havoc Pennington <hp@redhat.com> * src/theme-parser.c (meta_theme_load): look for themes in ~/.themes/NAME/metacity-1/ and datadir/themes/NAME/metacity-1 instead of the old locations. * src/themes/Makefile.am: install themes to datadir/themes/NAME/metacity-1/ to match how GTK works, breaking third-party themes yet again! woot!
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/frames.c2
-rw-r--r--src/menu.c1
-rw-r--r--src/theme-parser.c41
-rw-r--r--src/themes/Makefile.am22
5 files changed, 29 insertions, 39 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 97fed80f..af558b33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
SUBDIRS=wm-tester tools themes
-INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\"
+INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\"
EGGFILES= \
eggaccelerators.c \
diff --git a/src/frames.c b/src/frames.c
index 7580f707..fffdcfc5 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -1872,8 +1872,6 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_RESIZE_E;
}
}
-
- noresize:
return META_FRAME_CONTROL_NONE;
}
diff --git a/src/menu.c b/src/menu.c
index 07d2b9ea..a5429fe7 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <stdio.h>
+#include <string.h>
#include "menu.h"
#include "main.h"
#include "util.h"
diff --git a/src/theme-parser.c b/src/theme-parser.c
index 0518afbf..54ffe275 100644
--- a/src/theme-parser.c
+++ b/src/theme-parser.c
@@ -4181,9 +4181,14 @@ text_handler (GMarkupParseContext *context,
/* We change the filename when we break the format,
* so themes can work with various metacity versions
+ * (note, this is obsolete now because we are versioning
+ * the directory this file is inside, so oh well)
*/
#define THEME_FILENAME "metacity-theme-1.xml"
+/* now this is versioned, /usr/share/themes/NAME/THEME_SUBDIR/THEME_FILENAME */
+#define THEME_SUBDIR "metacity-1"
+
MetaTheme*
meta_theme_load (const char *theme_name,
GError **err)
@@ -4206,6 +4211,7 @@ meta_theme_load (const char *theme_name,
if (meta_is_debugging ())
{
+ /* Try in themes in our source tree */
theme_dir = g_build_filename ("./themes", theme_name, NULL);
theme_file = g_build_filename (theme_dir,
@@ -4227,34 +4233,15 @@ meta_theme_load (const char *theme_name,
}
}
- /* We try in current dir, then home dir, then system dir for themes */
- if (text == NULL)
- {
- theme_dir = g_build_filename ("./", theme_name, NULL);
-
- theme_file = g_build_filename (theme_dir,
- THEME_FILENAME,
- NULL);
-
- error = NULL;
- if (!g_file_get_contents (theme_file,
- &text,
- &length,
- &error))
- {
- meta_topic (META_DEBUG_THEMES, "Failed to read theme from file %s: %s\n",
- theme_file, error->message);
- g_error_free (error);
- g_free (theme_dir);
- g_free (theme_file);
- theme_file = NULL;
- }
- }
+ /* We try in home dir, then system dir for themes */
if (text == NULL)
{
theme_dir = g_build_filename (g_get_home_dir (),
- ".metacity/themes/", theme_name, NULL);
+ ".themes",
+ theme_name,
+ THEME_SUBDIR,
+ NULL);
theme_file = g_build_filename (theme_dir,
THEME_FILENAME,
@@ -4277,9 +4264,11 @@ meta_theme_load (const char *theme_name,
if (text == NULL)
{
- theme_dir = g_build_filename (METACITY_PKGDATADIR,
+ theme_dir = g_build_filename (METACITY_DATADIR,
"themes",
- theme_name, NULL);
+ theme_name,
+ THEME_SUBDIR,
+ NULL);
theme_file = g_build_filename (theme_dir,
THEME_FILENAME,
diff --git a/src/themes/Makefile.am b/src/themes/Makefile.am
index 6e5845fd..2dcf3449 100644
--- a/src/themes/Makefile.am
+++ b/src/themes/Makefile.am
@@ -5,18 +5,20 @@ THEMES= \
Esco \
Gorilla
-THEME_DIR=$(pkgdatadir)/themes
+THEME_DIR=$(datadir)/themes
+THEME_SUBDIR=metacity-1
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(THEME_DIR); \
- for THEME in $(THEMES); do \
- echo '-- Installing theme '$$THEME; \
- $(mkinstalldirs) $(DESTDIR)$(THEME_DIR)/$$THEME; \
- (installfiles=`find $(srcdir)/$$THEME -name "*.png" -o -name "*.xml"`; \
- for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
- $(INSTALL_DATA) $$i $(DESTDIR)$(THEME_DIR)/$$THEME; \
- done) \
+ $(mkinstalldirs) $(DESTDIR)$(THEME_DIR); \
+ for THEME in $(THEMES); do \
+ echo '-- Installing theme '$$THEME; \
+ $(mkinstalldirs) $(DESTDIR)$(THEME_DIR)/$$THEME; \
+ $(mkinstalldirs) $(DESTDIR)$(THEME_DIR)/$$THEME/$(THEME_SUBDIR); \
+ (installfiles=`find $(srcdir)/$$THEME -name "*.png" -o -name "*.xml"`; \
+ for i in $$installfiles; do \
+ echo '-- Installing '$$i ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(THEME_DIR)/$$THEME/$(THEME_SUBDIR) ; \
+ done) \
done
dist-hook: