Red Hat Bugzilla – Full Text Bug Listing
|Summary:||focus doesn't follow mouse pointer after workspace switch|
|Product:||[Retired] Red Hat Public Beta||Reporter:||Alexandre Oliva <aoliva>|
|Component:||metacity||Assignee:||Havoc Pennington <hp>|
|Status:||CLOSED RAWHIDE||QA Contact:|
|Version:||phoebe||CC:||notting, petersen, wtogami|
|Target Milestone:||---||Keywords:||MoveUpstream, Triaged|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2003-02-18 23:55:58 EST||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Bug Depends On:|
Description Alexandre Oliva 2002-12-25 19:37:58 EST
From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021218 Description of problem: Even though `focus follows mouse' is enabled, after a workspace switch, the window that gets the focus may not be the one that the mouse pointer is in. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.Open two non- or partially-overlapping windows, say A and B, on the same workspace 2.Click on window A to bring it to the front 3.Switch to another workspace. 4.Move the mouse such that the pointer will point to window B 5.Switch back to the original workspace Actual Results: Window A gets the focus, even though the mouse is on window B. Expected Results: Since focus is set to follow the mouse, it should. It did on 8.0. Additional info: Not having the option to bring windows with focus to the front makes this misbehavior far more visible.
Comment 1 Havoc Pennington 2003-01-12 23:06:27 EST
Upstream as http://bugzilla.gnome.org/show_bug.cgi?id=103335
Comment 5 Havoc Pennington 2003-01-13 23:01:34 EST
I tracked this down, it's pretty simple; the EnterNotify when the workspace switch completes is ignored because when doing Alt+Tab we want to ignore EnterNotify caused by the little popup thingy, so the same code applies here. But it probably should not apply here. Since the EnterNotify does not focus the window the mouse pointer ends up in, the top window ends up focused as switching spaces focuses top window. Basically, mouse focus breaks keyboard navigation, because keynav does not move the mouse pointer, so there's a nest of hacks for ignoring the mouse pointer in specific cases (breaking the pointer location == focus location invariant), and it's a little bit fragile. There are various possible fixes, just have to put one in.
Comment 6 Alexandre Oliva 2003-01-14 01:00:05 EST
Thanks for the investigation. I suppose moving the mouse pointer on Alt-TAB is not an option? Say, to the center of the title of the window? I can see that some people might prefer otherwise, but if it's to preserve an invariant, it might be worth it.
Comment 7 Alexandre Oliva 2003-02-18 23:55:58 EST
Comment 8 Jens Petersen 2004-08-05 05:40:40 EDT
I would really prefer (an option at least) that when returning to a workspace the window that last had focus there be given it back. Do people really think, "Ah I want to use the terminal in the top left corner on desktop1 now so better move the cursor there before switching over.."? I sure don't, but maybe it's just me?
Comment 9 Alexandre Oliva 2004-08-09 00:38:22 EDT
If you don't have focus-follows-mouse enabled, I see that your suggestion makes a lot of sense. But if focus is supposed to follow the mouse, having the focus on a window that doesn't have the mouse on it after switching desktops doesn't feel like the right approach.