GNOME Bugzilla – Bug 167199
No window has focus after switching workspace (with focus on a parent window of a transient)
Last modified: 2005-02-20 22:55:26 UTC
Under certain circumstances you can get into a situation where when switching back to a workspace that previously had a focused window, you no longer do: 1) Find a transient window, and focus it's parent 2) Switch to another workspace (doesn't matter how) 3) Switch back to the first workspace using the pager or a "switch to workspace <n>" keybinding You will end up with no windows focused. Oddly this doesn't happen if you use the switch to left / right workspace keybindings, and it also appears you need to be in click to focus mode.
Corrections: 1) It does happen if you use switch to left/right/above/below keybindings. However, it is corrected as soon as you let go of the relevant modifier key you have pressed (i.e. when the popup window goes away) 2) It appears for all three focus modes. (I hadn't noticed before because I always use the left/right/above/below keybindings and tend to release them quickly--or perhaps I just don't pay attention very closely) It turns out that the correct window is getting focused, but it's also getting unfocused. Apparently we are getting a FocusOut event that we're not filtering out in these cases; and it appears that a variety of modes and details occur under these circumstances (I haven't yet figured out how to reproduce any of them reliably, but it always seems to be one of these three when I'm trying to reproduce this bug): 1) mode = NotifyNormal, detail = NotifyNonlinearVirtual 2) mode = NotifyWhileGrabbed, detail = NotifyNonlinearVirtual 3) mode = NotifyWhileGrabbed, detail = NotifyNonlinear Naturally, attempting to filter out FocusOut events with these combinations of modes & details in meta_window_notify_focus messes up all kinds of stuff... *sigh*
hack, hack, hackity, hack...so much for working on the 2.10 showstoppers today ;-) Okay, so I did an overhaul to the meta_window_notify_focus stuff hoping that maybe it could solve this (and perhaps help with bug 158626). Turns out my overhaul didn't help with this bug (though it does show promise for a number of other reasons), but it helped track the bug down. The problem in this bug is that meta_window_show has some code to ignore the meta_window_focus or demands_attention=TRUE part of the code if the window isn't showing for the first time. However, there's another section of code related to focusing&stacking as well but it isn't ignored under the same circumstances--that section of code was calling meta_display_focus_the_no_focus_window after blocking the server for a new timestamp... Patch coming up in a minute.
Created attachment 37419 [details] [review] Ignore all focus and focus-stealing-prevention code in meta_window_show when not showing the window for the first time
ping?
Comment on attachment 37419 [details] [review] Ignore all focus and focus-stealing-prevention code in meta_window_show when not showing the window for the first time thanks
committed.