! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Keyboard shortcuts steal (borrow without asking) application focus


Description Da Fox 2011-06-04 13:01:55 CEST
I recently bought a new laptop, and in contrast to my old laptop the various function buttons are no longer hardware-controlled and require software interaction in order to function. Brightness is handled by the kernel, but in particular the 'volume-up', 'volume-down' and 'mute' buttons don't operate at all. Therefore I have mapped those keys to their respective XF86xxx mapping (e.g. XF86AudioRaiseVolume and friends), and use the 'application shortcuts' (Settings -> Keyboard -> Application Shortcuts) to run the 'amixer' program with the appropriate commands. All this works fine (e.g. I can control my volume).

However, now when I use one of these function keys, the focus is briefly moved from the currently active program to somewhere else (I don't see where, perhaps to amixer? although this is a console program? Or maybe the shortcut-daemon?). This causes an annoying blinking of various interface elements (e.g. a button or text field which has the focus, and indicates so with a highlight-colour will switch to/from the highlight-colour to the unfocused-colour and back).

More importantly (for me) this also causes programs which react to to 'lost focus' by auto-hiding to auto-hide whenever I press one of my media-keys (one such example is the 'guake-terminal', but there may be others).  
I've done a quick test with 'xev'. When no shortcut is set all I see in 'xev' is the XF86xxx key. When a short *is* set, the XF86xxx key no longer shows up in 'xev', however I do see a bunch of 'FocusIn', 'FocusOut' and 'KeyMap' events.  

Some searching on google also turned up this (related) bug:
Which it seems has been (partly) fixed in flash-player. At least my flash-player will not de-fullscreen when I press one of my media keys, although it does blink annoyingly (the whole screen blinks bright white when I press a media-key). Of particular interest is comment #32 in the linked bug report, which details why this is happening, and possible solutions (and why they are hard to implement). Still I think it would be nice if anything could be done on the part of xfce, just like (apparently) adobe did for flash.
Comment 1 Olivier Fourdan editbugs 2011-06-05 10:31:04 CEST
This really looks like a dupe of bug 7299

Keyboard grabs do generate a focus events:


If anything, it has to be addressed in the application, not something the window manager can avoid.

*** This bug has been marked as a duplicate of bug 7299 ***

Bug #7690

Reported by:
Da Fox
Reported on: 2011-06-04
Last modified on: 2011-06-05


Olivier Fourdan
CC List:
0 users



Additional information