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 699685 - Keyboard shortcuts launch apps in background
Keyboard shortcuts launch apps in background
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-04 21:27 UTC by Andreas Kloeckner
Modified: 2021-07-05 14:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Kloeckner 2013-05-04 21:27:49 UTC
I have the KDE Terminal "konsole" bound to a key in the settings on keyboard shortcuts. Hitting that shortcut reliably launches Konsole in the background. I think it's reasonable to assume that users launch applications because they'd like to interact with them, so giving a keyboard-launched app focus seems like a safe bet.
Comment 1 Adam Batkin 2014-08-13 02:30:32 UTC
Still broken on 3.10
Comment 2 Adam Batkin 2014-09-08 03:23:03 UTC
And also broken on 3.12. Easily reproducible.
Comment 3 Michael Catanzaro 2014-09-11 04:26:52 UTC
FWIW, if I have a shortcut for launching gnome-terminal, and it reliably has focus when launched. I bet this is a duplicate of bug #732762.

How does the shell decide whether or not to focus the main window when an app is launched?
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-09-11 05:29:01 UTC
See https://git.gnome.org/browse/mutter/tree/src/core/window.c#n1982
Comment 5 Richard J Turner 2014-09-11 06:58:06 UTC
I have the same problem launching Empathy using a keyboard shortcut, which makes initiating an IM chat without using the mouse more cumbersome than it ought to be.
Comment 6 Adam Batkin 2014-09-12 03:31:53 UTC
(In reply to comment #4)
> See https://git.gnome.org/browse/mutter/tree/src/core/window.c#n1982

So the low-level "why" this happens is "It's a Feature" (i.e. an explicit behavior in the code). Does anyone else think that this behavior needs some modification in order to accommodate people launching programs because they intend to immediately use them? It makes it pretty hard to use my system where my workflow includes the frequent opening of new terminal windows.

(I'm focusing on the terminal case because my only two hotkeys are for Firefox and Konsole and for whatever reason Firefox seems to always work and Konsole only sometimes works. I think the pattern is that it works when there are no other Konsoles open, and doesn't work when there is one somewhere else that doesn't have the focus)
Comment 7 Jasper St. Pierre (not reading bugmail) 2014-09-12 03:49:28 UTC
The answer is that it's a feature known as "focus stealing prevention". There might be a bug in our implementation of the feature, or in Firefox's implementation of the feature, or in Konsole's implementation of the feature, or in all three.
Comment 8 Adam Batkin 2014-09-12 05:15:54 UTC
(In reply to comment #7)
> The answer is that it's a feature known as "focus stealing prevention". There
> might be a bug in our implementation of the feature, or in Firefox's
> implementation of the feature, or in Konsole's implementation of the feature,
> or in all three.

Unless there's a way to completely disable focus stealing prevention, do you have any suggestions for how to proceed with figuring out what the actual issue is (or a workaround)?
Comment 9 GNOME Infrastructure Team 2021-07-05 14:20:14 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.