summaryrefslogtreecommitdiff
path: root/gtk/gtksettings.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-03-17 00:57:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-03-21 22:19:19 -0400
commit7cb36aba404c699f83579e039d6e97525b261231 (patch)
tree063ae999d6e2554cc265f8dca1d55db247393741 /gtk/gtksettings.c
parent475d916eb92c0106d09525bcca938f05fd6a81b5 (diff)
downloadgtk+-7cb36aba404c699f83579e039d6e97525b261231.tar.gz
Load theme settings from the right location
When loading a per-theme settings.ini file, look for it in the same directory where we found the gtk.css file for the theme. Previously, we were always looking in $prefix/share/themes/THEME/gtk-3.0/, even if the css was loaded from somewhere else. https://bugzilla.gnome.org/show_bug.cgi?id=641354
Diffstat (limited to 'gtk/gtksettings.c')
-rw-r--r--gtk/gtksettings.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 627516724b..e91a734b7e 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -3219,7 +3219,7 @@ settings_update_theme (GtkSettings *settings)
GtkSettingsPrivate *priv = settings->priv;
gchar *theme_name;
gchar *theme_variant;
- gchar *theme_dir;
+ const gchar *theme_dir;
gchar *path;
get_theme_name (settings, &theme_name, &theme_variant);
@@ -3228,16 +3228,17 @@ settings_update_theme (GtkSettings *settings)
theme_name, theme_variant);
/* reload per-theme settings */
- theme_dir = _gtk_css_provider_get_theme_dir ();
- path = g_build_filename (theme_dir, theme_name, "gtk-3.0", "settings.ini", NULL);
-
- if (g_file_test (path, G_FILE_TEST_EXISTS))
- gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_THEME);
+ theme_dir = _gtk_css_provider_get_theme_dir (priv->theme_provider);
+ if (theme_dir)
+ {
+ path = g_build_filename (theme_dir, "settings.ini", NULL);
+ if (g_file_test (path, G_FILE_TEST_EXISTS))
+ gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_THEME);
+ g_free (path);
+ }
g_free (theme_name);
g_free (theme_variant);
- g_free (theme_dir);
- g_free (path);
}
static void