GNOME Bugzilla – Bug 676300
super+p does not trigger the video switch
Last modified: 2012-06-11 18:15:11 UTC
I tested on Ubuntu 12.04 with g-s-d 3.4.1, g-s-d receives the <Mod4> modifier (rather than <Super>). The attached patch can make the video switching function work with super+p.
Created attachment 214296 [details] [review] add an item of <mod4>p in shortcuts-list.h
Review of attachment 214296 [details] [review]: Mod4 and Super are supposed to resolve to the same modifier mask, so this patch isn't correct. Find out why the keys aren't matching.
I have another patch for gtk+3.0.4.1/gdk/x11/gdkkeys-x11.c : gdk_x11_keymap_map_virtual_modifiers(). Please help review the patch.
Created attachment 214432 [details] [review] unsetting the vmod in gdk_x11_keymap_map_virtual_modifiers()
Patches against 3.0.x are not the most helpful as 3.0.x is not maintained anymore, but thanks for attaching it for reference so somebody could turn it into a patch against git master or 3.4.x.
I confirmed that the patch can be applied on the 3.5.2-series. `git describe` on my local tree is 3.5.2-135-g7fe5139. Please help review this patch for the inclusion in gtk.
Review of attachment 214432 [details] [review]: Sorry, but map_virtual_modifiers needs to do exactly what it is doing now; gtk relies on this behaviour. You will have to mask out the virtual modifiers in your code.
@Matthias Are you suggesting to mask out the virtual modifiers in gnome-settings-daemon in the case of this bug?
right, I think he's saying g-s-d needs to do modifiers = key->state; gdk_keymap_map_virtual_modifiers (gdk_keymap_get_default (), &modifiers); modifiers &= (GDK_SHIFT_MASK | GDK_LOCK_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK | GDK_MOD4_MASK | GDK_MOD5_MASK); Though, fixing that shouldn't fix your problem, since even if some combinations of modifiers were failing you'd expect the valid modifiers to suceed. Could it be after the key is grabbed, Super is changing to something other than MOD4 ? Are you changing keymaps and g-s-d insn't noticing, maybe?
Hi, Ray, I think the code snippet from you can fix the bug I am facing. Thanks for it. I will be forming another patch for g-s-d.
Created attachment 214634 [details] [review] mask out virtual modifiers
Review of attachment 214634 [details] [review]: Looks correct indeed. Needs to go in gnome-3-4 and master.
I'm still surprised it fixes your problem given XIGrabKeycode supports "partial successes" where it returns the grabs that failed in the modifiers_inout variable.
*** Bug 676610 has been marked as a duplicate of this bug. ***
@Bastien Are you happy with committing the patch in the git or you have any other suggestion to the patch?
pushed