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 676300 - super+p does not trigger the video switch
super+p does not trigger the video switch
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
: 676610 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-05-18 09:42 UTC by Keng-Yu Lin
Modified: 2012-06-11 18:15 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4


Attachments
add an item of <mod4>p in shortcuts-list.h (790 bytes, patch)
2012-05-18 09:45 UTC, Keng-Yu Lin
rejected Details | Review
unsetting the vmod in gdk_x11_keymap_map_virtual_modifiers() (1.08 KB, patch)
2012-05-19 02:25 UTC, Keng-Yu Lin
rejected Details | Review
mask out virtual modifiers (1.30 KB, patch)
2012-05-22 07:27 UTC, Keng-Yu Lin
committed Details | Review

Description Keng-Yu Lin 2012-05-18 09:42:24 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.
Comment 1 Keng-Yu Lin 2012-05-18 09:45:33 UTC
Created attachment 214296 [details] [review]
add an item of <mod4>p in shortcuts-list.h
Comment 2 Bastien Nocera 2012-05-18 09:50:25 UTC
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.
Comment 3 Keng-Yu Lin 2012-05-19 02:24:18 UTC
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.
Comment 4 Keng-Yu Lin 2012-05-19 02:25:16 UTC
Created attachment 214432 [details] [review]
unsetting the vmod in gdk_x11_keymap_map_virtual_modifiers()
Comment 5 André Klapper 2012-05-19 09:09:52 UTC
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.
Comment 6 Keng-Yu Lin 2012-05-21 06:27:20 UTC
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.
Comment 7 Matthias Clasen 2012-05-21 10:05:42 UTC
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.
Comment 8 Keng-Yu Lin 2012-05-21 13:36:48 UTC
@Matthias
  Are you suggesting to mask out the virtual modifiers in gnome-settings-daemon in the case of this bug?
Comment 9 Ray Strode [halfline] 2012-05-21 16:31:23 UTC
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?
Comment 10 Keng-Yu Lin 2012-05-22 07:24:37 UTC
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.
Comment 11 Keng-Yu Lin 2012-05-22 07:27:22 UTC
Created attachment 214634 [details] [review]
mask out virtual modifiers
Comment 12 Bastien Nocera 2012-05-22 13:26:20 UTC
Review of attachment 214634 [details] [review]:

Looks correct indeed. Needs to go in gnome-3-4 and master.
Comment 13 Ray Strode [halfline] 2012-05-22 14:23:44 UTC
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.
Comment 14 Bastien Nocera 2012-05-23 10:07:49 UTC
*** Bug 676610 has been marked as a duplicate of this bug. ***
Comment 15 Keng-Yu Lin 2012-06-08 07:52:55 UTC
@Bastien
  Are you happy with committing the patch in the git or you have any other suggestion to the patch?
Comment 16 Ray Strode [halfline] 2012-06-11 18:15:08 UTC
pushed