GNOME Bugzilla – Bug 653085
focus change issues on workspace change with multiple monitors
Last modified: 2021-07-05 14:36:34 UTC
I regularly get confused by the workspace focus behaviour in the multi monitor case. I have a setup where xchat is always running on the non-primary monitor, then I keep various work windows on different workspaces, often maximized. The way focus currently work is that we remember the focused window for every workspace and when we switch to a workspace we focus the rembered window. However, sometimes the focused window is on the non-primary monitor, and this is where things get confused. For instance, lets say xchat (on the non-primary window) is *not* focused, and you're looking at a fullscreen focused window on the primary monitor, then you switch to a workspace with a maximized firefox. If, when you last visited that workspace xchat was the focused window then xchat will get the focus after the switch (even if it was previously visible but not focused). Then I commonly assume firefox is focused (because I was just looking at the primary monitor, and unfocused maximized windows are not obvious) press ctrl-L and marvel at the cleared backlog in my xchat buffer. I'm not sure what the best behaviour would be though, maybe if the focus is on a non-primary-monitor (or sticky) window and we should keep the focus on workspace switch, but if the focused window was lost due to the workspace switch we should always make a window on the primary monitor have the focus.
Also, its kinda confusing that the stacking order is different on the non-primary monitors on different workspaces.
This is still an issue. IMHO, the best thing to do would be to remember the focused window for every workspace _and_ for every monitor. When we change workspace, we'd focus the window on the new workspace but on the same monitor. So the goal is to never change focus away from the current monitor when we change workspace or when we close a window (!) unless the user focused on it manually, or we run out of windows. I'd argue even alt-tab behaviour would favour sticking to the same monitor, but I can see people disagreeing with me here.
This is the reason I keep my laptop's screen off instead of using it as I wish I could. This unexpected focus change made me type important passwords on IRC channels way too many times (meaning 1), and it really makes the whole experience suck. I think windows in the fixed screen should only be focused by explicit user action.
This is, indeed, quite annoying. Another thing is that, using "exposé" and clicking with the mouse on a window in a different Workspace than the initial, doesn't either give the focus to the chosen windows. The example with XChat applies also here: XChat gets the focus in the non-primary monitor rather than the clicked window.
+1 angry user and why it still UNCONFIRMED?
I quite often have fullscreen window on the secondary monitor, and when I switch between workspaces on the primary monitor fullscreen window always steals focus. Another annoying thing is flickering of a fullscreen winow on the secondary monitor when I open drop down menus on the primary monitor. I did notice this on mpv and virtualbox.
I'm having the same issue on GNOME 3.14.
I'm using gnome-shell-3.16.2-1 from the fedora (22) repos, and I notice (almost) the same behaviour, I also had the same issue when using F21. When I switch workspaces on my laptop screen (I only have workspaces set up on my main screen, the second screen has only one workspace) the focus always goes to the second screen, I keep a VirtualBox VM on that screen (with capture all key presses disabled) and when I switch to another workspace, no matter what window had focus the last time I was on that workspace last the focus ALWAYS goes to my second screen. I've gotten used to the issue, but it is annoying that every time I want to switch workspaces I then have to click or alt-tab to the right window. I've also tested that this happens with other windows, so I placed chrome over on the second screen, without making it full screen, changed workspace, ctrl-n creates a new tab in chrome on the second screen. I agree with everything that Mourad De Clerck mentioned in comment 2, but I am not so worried about alt-tab behaviour being tied to the window I am currently on, personally I rarely use alt-tab to select what's running in my second screen, so either way is fine. But an option to allow this might be a good idea!
I'm also having this issue, and it's becomming kinda annoying, and it's the same as jamesrstocker. I have a laptop with GNOME Shell 3.20.2 on an Arch distribution, with a pinned window (always on visible space). If I switch workspace (let's say from a terminal to a Chrome, on space 1), the focus is _always_ on the window I put the option on, and same thing whenever I switch back to workspace 2. I don't want to set the the focus mode on mouse or sloppy (I don't want to switch focus wherever I put my mouse on...), as suggested in a stackoverflow question (http://askubuntu.com/questions/640805/gnome-shell-multi-desktop-changes-focus-to-other-screen)
*** Bug 780417 has been marked as a duplicate of this bug. ***
This bug is very frustrating as it basically makes using a multiple monitor setup unusuable. With the focus randomly switching to the secondary montior, it is easy to send alt+F4 or other shortcuts that will reak havok in the window which has stolen focus.
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.