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 133120 - wrong focus when changing workspace
wrong focus when changing workspace
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2004-02-01 14:45 UTC by Sebastien Bacher
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4



Description Sebastien Bacher 2004-02-01 14:45:51 UTC
This bug was originally reported in the Debian BTS:
http://bugs.debian.org/210250

"I've got the same problem using 2.6.3 :-(. Autorise is off and it also
happens with and without running nautilus. Autofocus is on when mouse is
over windows...

I've tried with a fresh user (to see if it was a configuration problem and
I can still reproduce the problem). This are the steps to reproduce the
problem in my computer (hope it helps):

   - Create a new user and log into X
   - Go to "Applications/Desktop Preferences/Windows" and select "Select
windows when the mouse moves over them"
   - Go to "Applications/Desktop Preferences/Keyboard Shortcuts" and create
shortcuts for switching workspaces (I normally use Ctrl+F1, Ctl+F2, but
tried with others).
   - Open a window (a terminal will do). The window automatically gets the
focus (is the only window opened). If you move the mouse over it and then
over the background the focus stays on the terminal window as it's kind of
"sloppy".
   - Now, with the mouse OVER the background (not the focused window) move
to another workspace (using the KEYS) and go back to the previous
workspace. The result is that NO window is focused even that the terminal
is the only window in the workspace."
Comment 1 Elijah Newren 2004-02-02 05:29:16 UTC
I believe this occurs because
workspace.c:meta_workspace_activate_with_focus calls
meta_workspace_focus_default window.  Replacing it with
meta_workspace_focus_mru_window would be wrong because if the mouse
enters a window upon switching workspaces, then it should be focused.
 Thus, the behavior I believe you want is to focus the 'default'
window if one is found and otherwise to focus the 'MRU' (most recently
used) window.  Doing this would require a new function (although it'd
be trivial to write as it's mostly just cut and paste from the two
previously mentioned existing functions).  Note that this would only
be for sloppy focus and NOT for mouse focus, because for mouse focus
we really don't want a window focused if the pointer isn't in it.

I don't care too much either way (since I use mouse focus), but if the
Metacity maintainers would like this then I'll write a patch for it;
it should be fairly simple.
Comment 2 Rob Adams 2004-02-15 05:44:19 UTC
ostensibly this is intentional, since there s code to explicitly work
this way for sloppy and mouse focus.  Theoretically, sloppy focus
should focus the window underneath the mouse pointer when the
workspace is switched.  But now that we have the per-workspace MRU, it
may make more sense to simply focus the top window in sloppy focus as
well.

Either way I don't think we can make this change until after the Gnome
2.6 release, since we're past UI freeze.
Comment 3 Elijah Newren 2004-06-26 02:34:35 UTC
This has been fixed in CVS as part of the changes in bug 135810.