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!
This commit is contained in:
Havoc Pennington 2002-07-24 18:28:56 +00:00 committed by Havoc Pennington
parent 28958e51ef
commit 88a0d1ff03
6 changed files with 39 additions and 39 deletions

View File

@ -1,3 +1,13 @@
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!
2002-07-20 Havoc Pennington <hp@pobox.com>
* src/display.c (meta_display_open): grab display across managing

View File

@ -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 \

View File

@ -1873,8 +1873,6 @@ get_control (MetaFrames *frames,
}
}
noresize:
return META_FRAME_CONTROL_NONE;
}

View File

@ -21,6 +21,7 @@
#include <config.h>
#include <stdio.h>
#include <string.h>
#include "menu.h"
#include "main.h"
#include "util.h"

View File

@ -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,

View File

@ -5,17 +5,19 @@ 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; \
$(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; \
$(INSTALL_DATA) $$i $(DESTDIR)$(THEME_DIR)/$$THEME/$(THEME_SUBDIR) ; \
done) \
done