GNOME Bugzilla – Bug 673014
keybindings: Use a GSettings object rather than a schema, to support extensions
Last modified: 2012-04-17 16:49:34 UTC
Extensions need to be able to supply a GSettings object so they can pass something which has a GSchemaSettingsSource.
Created attachment 210799 [details] [review] keybindings: Use a GSettings object rather than a schema, to support extensions If we want to support keybindings from extensions installed in the user's directory, we can't take a schema, as the GSettings object needs to have a special GSettingsSchemaSource.
*** Bug 673032 has been marked as a duplicate of this bug. ***
I've tested this patch against the latest mutter (3.4.0 in fedora 17 alpha) and my shellshape extension, which uses custom keybindings. Happy to report that it works as advertised, so I'd love to see this make it into mutter ASAP.
Review of attachment 210799 [details] [review]: ::: src/core/prefs.c @@ +1952,3 @@ + if (pref->builtin) + { + if (g_object_get_data (settings, "changed-signal") != NULL) == NULL ?
Created attachment 211887 [details] [review] keybindings: Use a GSettings object rather than a schema, to support extensions If we want to support keybindings from extensions installed in the user's directory, we can't take a schema, as the GSettings object needs to have a special GSettingsSchemaSource. Nice catch!
OK, I tested with Shellshape to make sure that this patch works properly. It does. Shellshape has other issues, but they're not related to keybindings at all.
Created attachment 212173 [details] [review] windowManager: Adapt to mutter API change Trivial (shell) change, but required by the previous patch
Review of attachment 211887 [details] [review]: Some minor style issues. ::: src/core/keybindings-private.h @@ +75,2 @@ gboolean meta_prefs_add_keybinding (const char *name, + GSettings *settings, I'd include gio/gio.h explicitly rather than relying on it being included from somewhere else before including keybindings-private.h ::: src/core/prefs.c @@ +1962,3 @@ { + char *changed_signal; + changed_signal = g_strdup_printf ("changed::%s", name); Breaking up that line looks pointless
Comment on attachment 211887 [details] [review] keybindings: Use a GSettings object rather than a schema, to support extensions Attachment 211887 [details] pushed as 68321d9 - keybindings: Use a GSettings object rather than a schema, to support extensions Pushed with suggested style fixes.
Attachment 212173 [details] pushed as 7313172 - windowManager: Adapt to mutter API change (Had a similar patch locally)