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 695917 - Allow specifying multiple accelerators for the same action
Allow specifying multiple accelerators for the same action
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 679720 695758
 
 
Reported: 2013-03-15 15:31 UTC by Aleksander Morgado
Modified: 2014-03-10 23:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to handle multiple accels per action (1.38 KB, patch)
2014-03-10 23:21 UTC, Daniel Goetz
none Details | Review

Description Aleksander Morgado 2013-03-15 15:31:04 UTC
gtk_application_add_accelerator() will check if there is already a given accelerator for a given action, and if there is one, it will replace it with the new one passed. This actually blocks having more than one accelerator for the same action.
Comment 1 Christian Persch 2013-03-15 18:33:35 UTC
The code doing the lookup is doing this because gtk_accel_map_add_entry() documents this; but that's not the cause of there only being one accel per action allowed. The accel path is derived from the action name and its parameter GVariant, and the accel map can only have one entry for each accel path.
Comment 2 Bastien Nocera 2013-05-10 15:38:22 UTC
It makes gtk_application_add_accelerator() pretty useless for any application that wants to have 2 bindings for the same action. One would probably handle all the keyboard shortcuts by hand, or by installing an accel, not doing both.
Comment 3 Lars Karlitski 2013-12-11 14:06:43 UTC
*** Bug 693830 has been marked as a duplicate of this bug. ***
Comment 4 Allison Karlitskaya (desrt) 2013-12-11 14:20:17 UTC
gtk_application_set_accels_for_action() exists for a little while now...
Comment 5 Allison Karlitskaya (desrt) 2013-12-11 14:24:21 UTC
As for gtk_application_add_accelerator(): it has always replaced the existing accel, so I think it would be an incompatible change to make it add and keep the old one.  Perhaps we should deprecate it for having a confusing name.
Comment 6 Daniel Goetz 2014-03-10 23:21:27 UTC
Created attachment 271491 [details] [review]
Patch to handle multiple accels per action

in _initAction it is now checked, if actionEntry.accel is an array, if so, the new function "set_accels_for_action()" is used.