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 167199 - No window has focus after switching workspace (with focus on a parent window of a transient)
No window has focus after switching workspace (with focus on a parent window ...
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.9.x
Other Linux
: High normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 155450
 
 
Reported: 2005-02-12 21:00 UTC by Crispin Flowerday (not receiving bugmail)
Modified: 2005-02-20 22:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ignore all focus and focus-stealing-prevention code in meta_window_show when not showing the window for the first time (672 bytes, patch)
2005-02-13 00:07 UTC, Elijah Newren
accepted-commit_now Details | Review

Description Crispin Flowerday (not receiving bugmail) 2005-02-12 21:00:05 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.
Comment 1 Elijah Newren 2005-02-12 21:16:30 UTC
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*
Comment 2 Elijah Newren 2005-02-13 00:06:31 UTC
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.
Comment 3 Elijah Newren 2005-02-13 00:07:47 UTC
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
Comment 4 Elijah Newren 2005-02-15 17:59:01 UTC
ping?
Comment 5 Havoc Pennington 2005-02-20 20:38:45 UTC
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
Comment 6 Elijah Newren 2005-02-20 22:55:26 UTC
committed.