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 729657 - application from non-active virtual desktops can steal focus
application from non-active virtual desktops can steal focus
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: 2014-05-06 15:51 UTC by Tomasz Torcz
Modified: 2021-07-05 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomasz Torcz 2014-05-06 15:51:44 UTC
Focus handling got broken recently. Applications on non-active desktops can steal the focus from foreground apps. I've observed it in two scenarios:

Scenario I:

1) I have gnome-terminal on virtual desktop 1 and chromium browser on virtual desktop 2.
2) Virtual desktop 1 is active
3) I ctrl+click URL in terminal. URL gets sent to Chromium
4) Chromium opens the URL and STEALS FOCUS. Terminal window decorations turns insensitive.
5) Virtual desktop 1 (with terminal) is still active. There's no desktop switch taking place.
6) All the keystrokes go to Chromium window. The window which is on desktop 2 (not active, not displayed desktop)


Scenario II:
1) I use virt-manager to start virtual machine
2) I switch to other desktop before VM window appear. Virtual desktop with virt-manager becomes hidden.
3) When the VM window appear on now-hidden desktop, it takes focus and grabs the mouse pointer.
4) On active desktop, mouse pointer disappears. Keystrokes go to virtual machine window. Only after pressing alt+ctrl, virtual machine releases mouse and mouse cursor appear on current desktop.


The following rules is broken: only applications on current desktop can get focus.

Versions:
gnome-shell-3.12.1-1.fc20.x86_64
mutter-3.12.1-1.fc20.x86_64
Comment 1 Florian Müllner 2014-05-06 15:55:16 UTC
(In reply to comment #0)
> The following rules is broken: only applications on current desktop can get
> focus.

The rule was changed, not broken. See bug 728018 for context.
Comment 2 Florian Müllner 2014-05-06 19:03:29 UTC
Uhm, wait:

(In reply to comment #0)
> Scenario I:
> [...]
> 5) Virtual desktop 1 (with terminal) is still active. There's no desktop switch
> taking place.

This step is a bug - if the new focus window is on a different workspace, we should switch workspace first. For what it's worth, I'm not reproducing with gnome-terminal + Firefox, and I don't see why Chromium should make a difference here.


> Scenario II:
> [...]
> 3) When the VM window appear on now-hidden desktop, it takes focus and grabs
> the mouse pointer.

Again, if we don't prevent focus stealing, then there should be a workspace switch here.


Not sure what's happening, but reopening.
Comment 3 Tomasz Torcz 2014-07-11 15:31:50 UTC
Ping? What more can I provide? Some X11 traces?
Comment 4 Jan Niklas Hasse (Account disabled) 2017-11-14 15:53:28 UTC
> What more can I provide?

I'm also not able to reproduce this bug with Firefox. Can you reproduce this bug with Firefox or only with Chromium? Since it has been quite a few years since you reported this: Can you still reproduce this bug at all?
Comment 5 Tomasz Torcz 2017-11-14 16:53:38 UTC
I just checked – ctrl-clicking link in a terminal. The focus switches to browser window on another desktop, additionally desktop switches away to the one with browser.
But according to Comment 2, this is intended behaviour now, not a bug.

gnome-shell-3.26.2-1.fc27.x86_64 and Chrome Browser 62.0.3202.89
Comment 6 GNOME Infrastructure Team 2021-07-05 14:31:49 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.