The issue seems to be old. It could be fixed either in X, in GTK or in every application relying on GTK (Firefox in my case).
On launchpad, the issue is discussed there (not a duplicate) : https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1165649 On Mozilla's bugzilla, another ticket that talks about the issue : https://bugzilla.mozilla.org/show_bug.cgi?id=578265 An interesting ticket on stackoverflow : http://stackoverflow.com/questions/15270420/why-xgrabkey-generates-extra-focus-out-and-focus-in-events In X the problem comes from the XGrabKey function that internally calls the ActivateKeyboardGrab() function, which then perform focus event firing. However I still need to figure out why those focus events are fired. Maybe it makes sense for other kinds of scenario than installing a global keyboard hook. Regarding GTK I read in 2012 posts that something could be done, but I still need to figure out why 2 years later the problem is still here. A fix may be possible for Firefox but it will be less efficient because that will only fix one single application. Hopefully Mir or Wayland/Weston will naturally fix the problem. ** Bug watch added: Mozilla Bugzilla #578265 https://bugzilla.mozilla.org/show_bug.cgi?id=578265 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to unity-control-center in Ubuntu. https://bugs.launchpad.net/bugs/1397523 Title: Keyboard shortcuts steal temporarily the focus causing unwanted side effects Status in unity-control-center package in Ubuntu: New Bug description: version: Ubuntu 14.10 with Unity. procedure: 1. start an application than reacts to focus events (mouse click, alt+tab, ...) 2. ensure the application window has the focus 3. press any registered global shortcut key (for example printscreen or volume keys) expected result: the application does nothing special actual result: the application reacts to the key, as the focus was stolen and restored briefly backstory: I noticed an annoying behavior in Firefox where the fullscreen warning is triggered every time I press a global shortcut key as listed in Ubuntu's system parameters/keyboard/shortcuts. A bug exists in Mozilla's bugzilla: "X is now fullscreen. Press ESC to exit" message appears whenever I change volume or hit 'printscreen' key https://bugzilla.mozilla.org/show_bug.cgi?id=1084249 However, it appears that the problem is not in Firefox itself, and other applications are impacted. The starting point is the fact Firefox binds the fullscreen warning to the window manager focus event. After some investigation, it appears that every window on Ubuntu receives a quick couple of FocusOut then FocusIn X11 events every time a global shortcut key is pressed, triggering any action binded by the application related to those events (for games it usually lead to a pause). It would be nice if global shortcut keys had no impact at all on the current application window. Side note: I can't figure out which daemon controls global shortcut keys in Ubuntu so for now I used the unity-control-center category, but if you've got more knowledge please feel free to sort that ticket to the right category. ProblemType: Bug DistroRelease: Ubuntu 14.10 Package: unity-control-center 14.10.0+14.10.20140922-0ubuntu2 ProcVersionSignature: Ubuntu 3.16.0-25.33-generic 3.16.7 Uname: Linux 3.16.0-25-generic x86_64 ApportVersion: 2.14.7-0ubuntu8 Architecture: amd64 CurrentDesktop: Unity Date: Sat Nov 29 12:35:08 2014 EcryptfsInUse: Yes ExecutablePath: /usr/bin/unity-control-center InstallationDate: Installed on 2013-10-20 (405 days ago) InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1) LocalLibraries: /usr/local/lib/libunity-gtk3-parser.so.0.0.0 ProcEnviron: PATH=(custom, no user) LANGUAGE=fr_FR XDG_RUNTIME_DIR=<set> LANG=fr_FR.UTF-8 SHELL=/bin/bash SourcePackage: unity-control-center UpgradeStatus: Upgraded to utopic on 2014-10-25 (34 days ago) usr_lib_unity-control-center: deja-dup 32.0-0ubuntu1 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/unity-control-center/+bug/1397523/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp

