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 653613 - Support string array keybindings
Support string array keybindings
Status: RESOLVED FIXED
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:34 UTC by Florian Müllner
Modified: 2011-06-30 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Fix a small memory leak (986 bytes, patch)
2011-06-29 06:34 UTC, Florian Müllner
committed Details | Review
keyboard: Support string array keybindings (3.70 KB, patch)
2011-06-29 06:34 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-06-29 06:34:35 UTC
Metacity/Mutter supports either a single string or an array of strings to specify keybindings. With the port to GSettings, the former will be dropped and all keybindings are always stored as array of strings. I don't think it makes sense to expose multiple bindings per action in the UI, but unless we drop all wm shortcuts we'll have to support string array keybindings ...

The attached patch adds this support for bindings from GSettings, I don't see much of a point in doing the same for GConf.

(The first patch which fixes a small leak is unrelated, but attaching it here anyway as it shows up in the diff context of the second one ...)
Comment 1 Florian Müllner 2011-06-29 06:34:38 UTC
Created attachment 190905 [details] [review]
keyboard: Fix a small memory leak

Unless g_conf_client_get_string(), g_settings_get_string() always
returns a newly allocated string.
Comment 2 Florian Müllner 2011-06-29 06:34:41 UTC
Created attachment 190906 [details] [review]
keyboard: Support string array keybindings

Metacity/Mutter stores keybindings as string array to support multiple
bindings per action. Even though multiple bindings are not exposed in
the UI, support keybindings stored as string array by getting/setting
the first element of the array.
Comment 3 Bastien Nocera 2011-06-30 10:22:05 UTC
Review of attachment 190905 [details] [review]:

Looks good.
Comment 4 Bastien Nocera 2011-06-30 10:23:51 UTC
Review of attachment 190906 [details] [review]:

Looks good. Should this wait until mutter is ported to gsettings?
Comment 5 Florian Müllner 2011-06-30 12:12:38 UTC
Comment on attachment 190905 [details] [review]
keyboard: Fix a small memory leak

Attachment 190905 [details] pushed as a6d3ad6 - keyboard: Fix a small memory leak
Comment 6 Florian Müllner 2011-06-30 12:26:09 UTC
Attachment 190906 [details] pushed as b72c71a - keyboard: Support string array keybindings

(In reply to comment #4)
> Looks good. Should this wait until mutter is ported to gsettings?

Nah, let's get this off the queue. I'll do some more work on the keybindings code in metacity/mutter, but the schema will definitively use string arrays - the current gconf way of using both binding_name and binding_name_list is just too insane ...