diff options
author | Florian Müllner <fmuellner@gnome.org> | 2014-09-19 15:33:36 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2014-09-19 21:25:46 +0200 |
commit | a3e35131b62f206c1c70f6df9e5b8d0a235d5578 (patch) | |
tree | ad931dc776f89f2b276f94ed46495c861b4077a8 | |
parent | 4a2a4429823b7e96e34383bc54ee44b65d4b796c (diff) | |
download | gnome-settings-daemon-a3e35131b62f206c1c70f6df9e5b8d0a235d5578.tar.gz |
xsettings: Fix swapping out of WM settings schemas
Until we get session-specific defaults in GSettings, we pick up the
button-layout setting from different schemas depending on whether we
are running in classic mode or not. However there is a serious thinko
in the current implementation: When running in classic mode, the
settings value is swapped with the one from the classic schema,
otherwise it is used directly - which turns out to be wrong when
the value itself is taken from the classic schema, e.g. when receiving a
change notification (which apparently may even be the case randomly
at startup).
Avoid this confusion by not trying to add the classic schema unless
actually running in a classic session.
https://bugzilla.gnome.org/show_bug.cgi?id=736974
-rw-r--r-- | plugins/xsettings/gsd-xsettings-manager.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c index 142167f4..7e207940 100644 --- a/plugins/xsettings/gsd-xsettings-manager.c +++ b/plugins/xsettings/gsd-xsettings-manager.c @@ -338,17 +338,15 @@ translate_button_layout (GnomeXSettingsManager *manager, { GSettings *classic_settings; GVariant *classic_value = NULL; - const char *session; char *layout; /* Hack: until we get session-dependent defaults in GSettings, * swap out the usual schema for the "classic" one when * running in classic mode */ - session = g_getenv ("XDG_CURRENT_DESKTOP"); classic_settings = g_hash_table_lookup (manager->priv->settings, CLASSIC_WM_SETTINGS_SCHEMA); - if (session && strstr (session, "GNOME-Classic") && classic_settings) { + if (classic_settings) { classic_value = g_settings_get_value (classic_settings, "button-layout"); layout = g_variant_dup_string (classic_value, NULL); } else { @@ -1131,10 +1129,10 @@ gboolean gnome_xsettings_manager_start (GnomeXSettingsManager *manager, GError **error) { - GSettingsSchema *schema; GVariant *overrides; guint i; GList *list, *l; + const char *session; g_debug ("Starting xsettings manager"); gnome_settings_profile_start (NULL); @@ -1170,13 +1168,18 @@ gnome_xsettings_manager_start (GnomeXSettingsManager *manager, g_hash_table_insert (manager->priv->settings, WM_SETTINGS_SCHEMA, g_settings_new (WM_SETTINGS_SCHEMA)); - schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (), + session = g_getenv ("XDG_CURRENT_DESKTOP"); + if (session && strstr (session, "GNOME-Classic")) { + GSettingsSchema *schema; + + schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (), CLASSIC_WM_SETTINGS_SCHEMA, FALSE); - if (schema) { - g_hash_table_insert (manager->priv->settings, - CLASSIC_WM_SETTINGS_SCHEMA, - g_settings_new_full (schema, NULL, NULL)); - g_settings_schema_unref (schema); + if (schema) { + g_hash_table_insert (manager->priv->settings, + CLASSIC_WM_SETTINGS_SCHEMA, + g_settings_new_full (schema, NULL, NULL)); + g_settings_schema_unref (schema); + } } g_signal_connect (G_OBJECT (g_hash_table_lookup (manager->priv->settings, INTERFACE_SETTINGS_SCHEMA)), "changed::enable-animations", |