After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653614 - Support conditions in bindings from GSettings
Support conditions in bindings from GSettings
Status: RESOLVED WONTFIX
Product: gnome-control-center
Classification: Core
Component: Keyboard
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-29 06:36 UTC by Florian Müllner
Modified: 2011-07-14 12:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Fix should_show_key() for GSettings (2.16 KB, patch)
2011-06-29 06:36 UTC, Florian Müllner
reviewed Details | Review
keyboard: Improve support for conditions in GSettings entries (3.12 KB, patch)
2011-06-29 06:36 UTC, Florian Müllner
none Details | Review
keyboard: Fix should_show_key() for GSettings (2.29 KB, patch)
2011-06-30 12:10 UTC, Florian Müllner
none Details | Review

Description Florian Müllner 2011-06-29 06:36:10 UTC
should_show_key() currently assumes bindings from GConf, add support for GSettings there.
Comment 1 Florian Müllner 2011-06-29 06:36:13 UTC
Created attachment 190907 [details] [review]
keyboard: Fix should_show_key() for GSettings

KeyListEntries may specify a condition which determines whether the
binding should be displayed. Currently this is only supported for
entries specified in GConf, so add support for GSettings entries.
Comment 2 Florian Müllner 2011-06-29 06:36:17 UTC
Created attachment 190908 [details] [review]
keyboard: Improve support for conditions in GSettings entries

For GConf entries, the "key" attribute specifies the full location
of the setting, however for GSettings, the location is determined
by the combination of key name and schema. To support conditions
which use a comparison key from a different schema than the setting
in question, add support for an optional "key-schema" attribute.
Comment 3 Florian Müllner 2011-06-29 06:45:27 UTC
Oh, one thing that crossed my mind while working on this - a quick grep suggests that conditions are only used by metacity/mutter keybindings, and only to show/hide bindings depending on the number of workspaces. It's obviously crazy to show a huge list of actions á la "Switch to workspace 42", but I still wonder whether those conditions still make sense with the number of workspaces changing dynamically in GNOME Shell ...
Comment 4 Bastien Nocera 2011-06-30 10:15:28 UTC
(In reply to comment #3)
> Oh, one thing that crossed my mind while working on this - a quick grep
> suggests that conditions are only used by metacity/mutter keybindings, and only
> to show/hide bindings depending on the number of workspaces. It's obviously
> crazy to show a huge list of actions á la "Switch to workspace 42", but I still
> wonder whether those conditions still make sense with the number of workspaces
> changing dynamically in GNOME Shell ...

They only really make sense for metacity. They might make some sense for mutter/gnome-shell, but only up to a certain amount of workspaces. Alt+1, Alt+2, fine, but what after Alt+9 (or Alt+0)?
Comment 5 Bastien Nocera 2011-06-30 10:19:24 UTC
Review of attachment 190907 [details] [review]:

::: panels/keyboard/keyboard-shortcuts.c
@@ -167,3 @@
-  /* FIXME: We'll need to change that when metacity/mutter
-   * uses GSettings */
-  g_assert (entry->type == CC_KEYBOARD_ITEM_TYPE_GCONF);

What about the GCONF_DIR type?

@@ +177,3 @@
+
+      settings = g_settings_new (entry->schema);
+  else

I'm really not certain that will work as you expect when the actual key is in a different location to the key representing the number of workspaces.
Comment 6 Bastien Nocera 2011-06-30 10:20:54 UTC
As you mentioned earlier, I would really rather we nuked this horror. Under gnome-shell or metacity, always show shortcuts for the first 10 workspaces, and be done with that.
Comment 7 Florian Müllner 2011-06-30 12:10:23 UTC
Created attachment 191007 [details] [review]
keyboard: Fix should_show_key() for GSettings

(In reply to comment #5)
> What about the GCONF_DIR type?

Ooops. Fixed.


> I'm really not certain that will work as you expect when the actual key is in a
> different location to the key representing the number of workspaces.

It doesn't, that's why there's a second patch ...
Comment 8 Bastien Nocera 2011-07-14 12:54:52 UTC
We won't be using this, as we'll be removing conditions altogether.

The only thing it was used for was showing workspace-number-dependent keyboard shortcuts. With gnome-shell's dynamic workspaces, it makes little sense.

We'll remove the supporting code from the control-center when metacity's keybindings have been updated.