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 639532 - Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 639341
 
 
Reported: 2011-01-14 16:56 UTC by Rui Matos
Modified: 2011-01-16 18:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym (1.01 KB, patch)
2011-01-14 16:56 UTC, Rui Matos
needs-work Details | Review
Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym (998 bytes, patch)
2011-01-14 22:08 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2011-01-14 16:56:03 UTC
Follow up to bug 635569 and needed for bug 639341.
Comment 1 Rui Matos 2011-01-14 16:56:05 UTC
Created attachment 178332 [details] [review]
Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
Comment 2 Owen Taylor 2011-01-14 17:18:50 UTC
Review of attachment 178332 [details] [review]:

I don't think quite works - if someone goes into the keyboard capplet and sets up a new keybinding, they'll get the "real" keysym (grave, whatever) rather than the ABOVE_TAB keysym attached to the binding, so I think get_keybinding_action() actually needs to check both ways.
Comment 3 Rui Matos 2011-01-14 18:06:29 UTC
I don't see how that can be done on get_keybinding_action().

Shouldn't that be considered a new bug on the keyboard capplet which could then put the "<Alt>Above_Tab" string into gconf using a copy of your from bug 635569?

For testing I've done

$ gconftool-2 -s /apps/metacity/global_keybindings/switch_group -t string "<Alt>Above_Tab"
$ gconftool-2 -s /apps/metacity/global_keybindings/switch_group_backward -t string "<Shift><Alt>Above_Tab"

and it actually works.
Comment 4 Owen Taylor 2011-01-14 19:24:14 UTC
(In reply to comment #3)
> I don't see how that can be done on get_keybinding_action().

What's the problem? If the keysym is Above_Tab, check for a keybinding using Above_Tab, if that isn't found, check for a binding using XKeysymToKeyCode(). Might require a bit of code reorganization (maybe moving some code to a separate function.)

> Shouldn't that be considered a new bug on the keyboard capplet which could then
> put the "<Alt>Above_Tab" string into gconf using a copy of your from bug
> 635569?

Also have to consider older configurations - I'd rather we just made it work here.
Comment 5 Rui Matos 2011-01-14 22:08:22 UTC
Created attachment 178357 [details] [review]
Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
Comment 6 Rui Matos 2011-01-14 22:11:16 UTC
(In reply to comment #4)

You are right, of course, and I was being lazy :-)

It was actually easier to handle both cases than I thought after thinking a bit more about it.
Comment 7 Owen Taylor 2011-01-14 22:23:11 UTC
Review of attachment 178357 [details] [review]:

OK to commit with a tiny tweak (just let me know if you don't have a GNOME git account and I'll commit it for you)

::: src/core/keybindings.c
@@ +536,3 @@
   binding = display_get_keybinding (display, keysym, keycode, mask);
 
+  if (! binding && keycode == meta_display_get_above_tab_keycode (display))

No space in '! binding'
Comment 8 Owen Taylor 2011-01-16 18:57:18 UTC
Pushed with missing space fixed. Thanks!

Attachment 178357 [details] pushed as bbfc435 - Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym