prefs: connect to changed:: before reading the value of a setting

Otherwise glib might skip registering to change notifications

https://bugzilla.gnome.org/show_bug.cgi?id=746509
This commit is contained in:
Giovanni Campagna 2015-03-20 12:49:45 -07:00
parent f9e91bf007
commit a13f906ed1

View File

@ -2113,12 +2113,6 @@ meta_prefs_add_keybinding (const char *name,
pref->combos = NULL; pref->combos = NULL;
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0; pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
strokes = g_settings_get_strv (settings, name);
update_binding (pref, strokes);
g_strfreev (strokes);
g_hash_table_insert (key_bindings, g_strdup (name), pref);
if (pref->builtin) if (pref->builtin)
{ {
if (g_object_get_data (G_OBJECT (settings), "changed-signal") == NULL) if (g_object_get_data (G_OBJECT (settings), "changed-signal") == NULL)
@ -2140,6 +2134,12 @@ meta_prefs_add_keybinding (const char *name,
queue_changed (META_PREF_KEYBINDINGS); queue_changed (META_PREF_KEYBINDINGS);
} }
strokes = g_settings_get_strv (settings, name);
update_binding (pref, strokes);
g_strfreev (strokes);
g_hash_table_insert (key_bindings, g_strdup (name), pref);
return TRUE; return TRUE;
} }