GNOME Bugzilla – Bug 729657
application from non-active virtual desktops can steal focus
Last modified: 2021-07-05 14:31:49 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
(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.
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.
Ping? What more can I provide? Some X11 traces?
> 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?
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
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.