From 5a302cfa3549e0b371b21a765ba14acff2162073 Mon Sep 17 00:00:00 2001 From: infirit Date: Sat, 25 Oct 2014 15:24:42 +0200 Subject: Add in XDG_USER_DATA_DIR when looking for themes Based off metacity commit: 52a524ee4a7e14d99451ea3f596b353ddf7957d4 From: Jasper St. Pierre --- src/ui/theme-parser.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c index 91b565db..b7d22381 100644 --- a/src/ui/theme-parser.c +++ b/src/ui/theme-parser.c @@ -4101,7 +4101,8 @@ meta_theme_load (const char *theme_name, /* We try all supported major versions from current to oldest */ for (version = THEME_VERSION; (version > 0); version--) { - /* We try first in home dir, XDG_DATA_DIRS, then system dir for themes */ + /* We try first in home dir, XDG_USER_DATA_DIR, XDG_DATA_DIRS, + * then system dir for themes */ /* Try home dir for themes */ theme_dir = g_build_filename (g_get_home_dir (), @@ -4115,6 +4116,19 @@ meta_theme_load (const char *theme_name, if (!keep_trying (&error)) goto out; + /* Try XDG_USER_DATA_DIR second */ + theme_dir = g_build_filename (g_get_user_data_dir(), + "themes", + theme_name, + THEME_SUBDIR, + NULL); + + retval = load_theme (theme_dir, theme_name, version, &error); + g_free (theme_dir); + + if (!keep_trying (&error)) + goto out; + /* Try each XDG_DATA_DIRS for theme */ xdg_data_dirs = g_get_system_data_dirs(); for(i = 0; xdg_data_dirs[i] != NULL; i++) -- cgit v1.2.1