GNOME Bugzilla – Bug 530356
Pressing "Stop" send Eject
Last modified: 2008-04-29 08:45:28 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=346201 for details Reproducer: 1. Disable the media-keys plugin /apps/gnome_settings_daemon/plugins/media-keys/active false 2. Restart gnome-settings-daemon (a good ol' killall will do) 3. Bind F12 to that key: xmodmap -e "keycode 96 = XF86AudioStop XF86Eject" 4. Run test-media-keys in the gnome-settings-daemon sources 5. Press F12, the Eject popup will show up, instead of sending stop The problem is in match_key matching only on keycode, and ignoring the "Shift" state. As Eject is listed before Stop in the list of supported keys, it will be matched first. Patch below (with a FIXME)
Created attachment 110038 [details] [review] gsd-handle-keysyms.patch Just the "keyboard group" problem to fix.
Created attachment 110048 [details] [review] gsd-handle-keysyms-2.patch Handle XKB mode switch
I forgot an ifdef HAVE_X11_EXTENSIONS_XKB_H around have_xkb(), but you see the point...
I'd also change the + if (keyval == key->keysym + && (key->state & ~consumed & GSD_USED_MODS) == key->state) { + return TRUE; + } + return FALSE; to return (keyval == key->keysym && (key->state & ~consumed & GSD_USED_MODS) == key->state); Otherwise, please commit.
Created attachment 110096 [details] [review] gsd-handle-keysyms-3.patch Update with the changes mentioned above, and also check whether the pressed key matches either the upper or lower keyval with that keysym (otherwise Ctrl+Alt+O wouldn't work with CapsLock or Shift on).
Bugger, obviously, my patch wasn't as updated as it should have been. Patch: http://svn.gnome.org/viewvc/gnome-settings-daemon/trunk/plugins/common/gsd-keygrab.c?r1=306&r2=326 Committed to trunk 2008-04-29 Bastien Nocera <hadess@hadess.net> * plugins/common/gsd-keygrab.c (have_xkb), (match_key): When checking whether a key matches our key event, check the keysym from the key event, to avoid triggering another keybindings with the same keycode, but different keysym, Fixes Eject being triggered when pressing the Stop key with the default inet keymap (Closes: #530356)