GNOME Bugzilla – Bug 766270
mutter taking incorrect keygrabs
Last modified: 2016-05-12 18:47:33 UTC
We are having issues on ubuntu with 3.20 with mutter grabbing certain keys like "l" and "s". The patch in https://bugzilla.gnome.org/show_bug.cgi?id=758076 triggered this issue. ebassi did mention on IRC that it may have to do with migration of certain certains however we have the upstream migration code for that.
(In reply to darkxst from comment #0) > The patch in https://bugzilla.gnome.org/show_bug.cgi?id=758076 triggered > this issue. You are using wayland?
(In reply to Florian Müllner from comment #1) > You are using wayland? No, from irc discussions with ricotz and darkxst, it's been reported on X11 specifically.
The patch in question is commit 5d6af70 but I don't really see how this can break modifiers on X11. Also, this landed in mutter-3.20.2 and I am typing this test right now in GNOME on X11 using that version of mutter and both "l" and "s" work just fine here (in case, I did try <Super>l first and that worked as well). Moreover, it's worth noting that "<Super>l" and "'<Super>s'" are not grabbed by the same application in GNOME afaik, "<Super>l" is taken by g-s-d to enable the screensaver, whereas "<Super>s" is used by gnome-shell for text overview. - Is there anything in particular to do to trigger that issue? - Can you attach the output of the following commands on the system where this occurs: $ xmodmap $ gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys $ gsettings list-recursively org.gnome.shell.keybindings $ gsettings list-recursively org.gnome.mutter And also asked by rtcm on irc, can you run with META_DEBUG=keybindings and capture the output please?
In that case I don't see how the linked patch has anything to do with it.
(In reply to Florian Müllner from comment #4) > In that case I don't see how the linked patch has anything to do with it. That was my impression as well, that's why I thought commit 82a247c which was merged shortly after could be another candidate, but apparently this is not the case (as reported on irc).
$ xmodmap xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
org.gnome.settings-daemon.plugins.media-keys logout '<Control><Alt>Delete' org.gnome.settings-daemon.plugins.media-keys screenreader '<Alt><Super>s' org.gnome.settings-daemon.plugins.media-keys volume-mute 'XF86AudioMute' org.gnome.settings-daemon.plugins.media-keys volume-up 'XF86AudioRaiseVolume' org.gnome.settings-daemon.plugins.media-keys window-screenshot '<Alt>Print' org.gnome.settings-daemon.plugins.media-keys previous 'XF86AudioPrev' org.gnome.settings-daemon.plugins.media-keys control-center 'XF86Tools' org.gnome.settings-daemon.plugins.media-keys stop 'XF86AudioStop' org.gnome.settings-daemon.plugins.media-keys home 'XF86Explorer' org.gnome.settings-daemon.plugins.media-keys terminal '<Primary><Alt>t' org.gnome.settings-daemon.plugins.media-keys screenshot-clip '<Ctrl>Print' org.gnome.settings-daemon.plugins.media-keys magnifier '<Alt><Super>8' org.gnome.settings-daemon.plugins.media-keys help '' org.gnome.settings-daemon.plugins.media-keys search 'XF86Search' org.gnome.settings-daemon.plugins.media-keys custom-keybindings @as [] org.gnome.settings-daemon.plugins.media-keys magnifier-zoom-in '<Alt><Super>equal' org.gnome.settings-daemon.plugins.media-keys calculator 'XF86Calculator' org.gnome.settings-daemon.plugins.media-keys video-out '<Super>p' org.gnome.settings-daemon.plugins.media-keys eject 'XF86Eject' org.gnome.settings-daemon.plugins.media-keys window-screenshot-clip '<Ctrl><Alt>Print' org.gnome.settings-daemon.plugins.media-keys area-screenshot-clip '<Ctrl><Shift>Print' org.gnome.settings-daemon.plugins.media-keys media 'XF86AudioMedia' org.gnome.settings-daemon.plugins.media-keys www 'XF86WWW' org.gnome.settings-daemon.plugins.media-keys play 'XF86AudioPlay' org.gnome.settings-daemon.plugins.media-keys email 'XF86Mail' org.gnome.settings-daemon.plugins.media-keys volume-down 'XF86AudioLowerVolume' org.gnome.settings-daemon.plugins.media-keys decrease-text-size '' org.gnome.settings-daemon.plugins.media-keys on-screen-keyboard '' org.gnome.settings-daemon.plugins.media-keys next 'XF86AudioNext' org.gnome.settings-daemon.plugins.media-keys screenshot 'Print' org.gnome.settings-daemon.plugins.media-keys increase-text-size '' org.gnome.settings-daemon.plugins.media-keys max-screencast-length uint32 30 org.gnome.settings-daemon.plugins.media-keys magnifier-zoom-out '<Alt><Super>minus' org.gnome.settings-daemon.plugins.media-keys priority 0 org.gnome.settings-daemon.plugins.media-keys screencast '<Ctrl><Shift><Alt>R' org.gnome.settings-daemon.plugins.media-keys screensaver '<Super>l' org.gnome.settings-daemon.plugins.media-keys toggle-contrast '' org.gnome.settings-daemon.plugins.media-keys pause 'XF86AudioPause' org.gnome.settings-daemon.plugins.media-keys active true org.gnome.settings-daemon.plugins.media-keys area-screenshot '<Shift>Print' org.gnome.shell.keybindings toggle-message-tray ['<Super>v', '<Super>m'] org.gnome.shell.keybindings open-application-menu ['<Super>F10'] org.gnome.shell.keybindings pause-resume-tweens @as [] org.gnome.shell.keybindings toggle-application-view ['<Super>a'] org.gnome.shell.keybindings focus-active-notification ['<Super>n'] org.gnome.shell.keybindings toggle-overview ['<Super>s'] org.gnome.mutter org.gnome.mutter attach-modal-dialogs false org.gnome.mutter auto-maximize true org.gnome.mutter overlay-key 'Super_L' org.gnome.mutter dynamic-workspaces false org.gnome.mutter edge-tiling false org.gnome.mutter draggable-border-width 10 org.gnome.mutter workspaces-only-on-primary false org.gnome.mutter focus-change-on-pointer-rest false org.gnome.mutter center-new-windows false org.gnome.mutter no-tab-popup false org.gnome.mutter.keybindings toggle-tiled-right ['<Primary><Super>Right', '<Super>Right'] org.gnome.mutter.keybindings toggle-tiled-left ['<Primary><Super>Left', '<Super>Left'] org.gnome.mutter.keybindings tab-popup-cancel @as [] org.gnome.mutter.keybindings tab-popup-select @as []
I am not seeing anything obvious in either xmodmap (I have exactly the same) nor the key bindings... Maybe the output of "MUTTER_VERBOSE=1 gnome-shell --replace" might give some hints?
Created attachment 327651 [details] [review] keybindings: Avoid using unitialized memory and grabbing random keys meta_parse_accelerator() considers 0 length accelerator strings as valid, meaning that the keybinding should be disabled. Unfortunately, it doesn't initialize the MetaKeyCombo so if the caller doesn't initialize it either, we end up using random values and possibly grabbing random keys.
Review of attachment 327651 [details] [review]: Fixes the issue
Review of attachment 327651 [details] [review]: OK
Attachment 327651 [details] pushed as e160bab - keybindings: Avoid using unitialized memory and grabbing random keys