Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 6220 - Workbench is automatically brought to front in focus follows mouse mode
Summary: Workbench is automatically brought to front in focus follows mouse mode
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-22 03:04 EST by Richard Colley CLA
Modified: 2019-03-22 09:37 EDT (History)
6 users (show)

See Also:


Attachments
Patch to fix bug 6220 in org.eclipse.swt.widgets.Control (338 bytes, patch)
2002-01-23 18:57 EST, Richard Colley CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Colley CLA 2001-11-22 03:04:55 EST
It is not common for people to use "focus follows mouse" in windows, but I do.  
When I happen to move my mouse over any eclipse window, it is popped to the 
front of other windows.

To turn on sloppy focus in WinNT, set the following registry var:

    HKEY_CURRENT_USER\Control Panel\Mouse\ActiveWindowTracking = 1 (DWORD)

If it doesn't exist, create it as a DWORD.

Then to test, start eclipse and any other window together.  Make sure the 
windows overlap, but you can see parts of both windows.  Now click on the non-
eclipse window.  It'll come to the top.  Now just move the mouse over the 
eclipse window, and it will be brought to the front without clicking.  Why???  
Please disable this.  It should only come to front when clicked on, like all 
other apps.
Comment 1 Richard Colley CLA 2001-11-22 03:20:09 EST
It may be related to Bug# 4705.
Comment 2 Kevin Haaland CLA 2001-11-22 21:31:41 EST
Simon, Pls investigate. Get help from the SWT team once you have 
configured "Sloppy Windows" on a test machine. 

Comment 3 Simon Arsenault CLA 2001-12-07 15:17:58 EST
I do not have an NT box, I have Windows 2000. So I tried changing the registry 
var (was set to zero) to be 1. Rebooted and it does not seem to have taken 
effect. Is this reg entry supported on Windows 2000?
Comment 4 Richard Colley CLA 2001-12-13 00:29:24 EST
I was using Windows NT 4, not 2000.  I tried Win2000, and the mouse tracking 
option doesn't work for me either.  After a web search through google, I have 
come to the conclusion that it is possible under win2000, but only by using 
Microsoft's TweakUI tool.  I haven't tried this yet.  To get TweakUI, go here:

  
http://www.microsoft.com/ntworkstation/downloads/PowerToys/Networking/NTTweakUI.
asp
Comment 5 Kevin Haaland CLA 2001-12-13 11:13:52 EST
Richard,

We do not have the cycles to look at this problem right now. Since it is 
obvious that you really care about solving this problem I encourage you to 
write the code and submit a patch. 

If you are interested, let me know through the developer's mailing list; and I 
will help set you up with a self hosting environment. 
Comment 6 Simon Arsenault CLA 2002-01-22 10:22:50 EST
No cycle to do this and no volunteers from the community yet to address this 
issue.
Comment 7 Simon Arsenault CLA 2002-01-23 09:40:21 EST
Seem like the Reporter is currently looking into this problem and has a patch 
in the works.
Comment 8 Richard Colley CLA 2002-01-23 18:57:11 EST
Created attachment 252 [details]
Patch to fix bug 6220 in org.eclipse.swt.widgets.Control
Comment 9 Richard Colley CLA 2002-01-23 19:00:53 EST
I have attached a proposed fix to this bug as attachment 252 [details] (see below).  It 
is a patch to the Eclipse 20020122 integration release on the class 
org.eclipse.swt.widgets.Control.

The problem is that forceFocus() raises the window to the top un-necessarily.  
I have done some testing, and the problem is fixed, and there doesn't seem to 
be any unintended side-effects.
Comment 10 Simon Arsenault CLA 2002-01-25 17:30:12 EST
Here is a contribution from Richard Colley. Can you have someone on SWT to 
verify and accept/reject this fix?
Comment 11 Steve Northover CLA 2002-05-15 23:36:26 EDT
Grant, I don't expect you to fix this necessarily but you are looking at this 
issue on Linux.  I don't believe we can remove this line safely - we need to 
find out how a C program is supposed to handle ActiveWindowTracking on Windows 
and do the same thing.

Low priority because Windows users never use this mode.
Comment 12 Jan Peter Hecking CLA 2002-11-25 06:02:36 EST
Just wanted to let you know that there *are* Windows users who use this mode.
I'd like to switch from Netbeans to Eclipse but this bug is really annoying. Oh,
and btw. I'm using Windows XP Pro.
Comment 13 Steve Bucknam CLA 2003-08-05 16:12:07 EDT
How can we get this fix in?  I know several people that really hate this bug. 
What can I do to help move this along?
Comment 14 Grant Gayed CLA 2003-08-05 16:32:21 EDT
I'll revisit this tomorrow with SN.
Comment 15 Steve Northover CLA 2003-08-05 18:08:58 EDT
The issue is that we need to know how the Windows controls honour "focus 
follows mouse".  Obviously, the Windows button control doesn't call 
OS.BringWindowToTop().  Whatever it calls, we should also be calling.  Because 
this is a UI Tweak, I couldn't find any documentation about it (but there may 
be some now).
Comment 16 Steve Bucknam CLA 2003-08-06 12:11:07 EDT
Steve N, I'm not sure I'm following.  The problem is that on eclipse gaining
focus by the OS and code in Control.java is calling:

    shell.bringToTop();

This code should not be called programatically upon gaining focus.  It should
only be called programatically to force a window to popup, or when a button
click occurs in any eclipse window (this is when Windows brings a window to the
top).

Is there a reason why this code is being called when a window receives focus, or
is it intended to be called when the OS (user) tries to bring eclipse to the top?
Comment 17 Steve Northover CLA 2003-08-06 18:32:40 EDT
Fixed > 20030806

Richard and Steve,

Once upon a time in the dark and distant past, it seemed that OS.SetFocus() 
would not activate or bring windows to the top.  In those bad old days, it was 
necessary to call OS.BringWindowToTop() to make it happen.  This may have been 
back as far as Windows 3.11.  Now things seem to be different and OS.SetFocus
() not only activates the window but does the "right thing".  When 
ActiveWindowTracking is false, windows are brought to the top and activated.  
When it is true, windows are only activated.

So, it looks like the right code was to delete the line.  Sorry it took so 
long but we needed to prove this with lots of test code running on Windows 98, 
2000 and XP.  The issue here was that most people don't run in this mode and 
we were afraid to break everyone else.

NOTE: We are on the look out for "bring to top" related problems in Eclipse!

Grant and Steve
Comment 18 Richard Colley CLA 2003-08-06 22:21:02 EDT
Wow!  This was so long ago I thought it had been lost somewhere.

Thanks guys!
Comment 19 Steve Northover CLA 2003-08-07 09:33:19 EDT
Not lost but the issue came up again and we had the time between 2.0 and 3.0 
to get to the bottom of it.
Comment 20 Yves anonymous CLA 2019-03-22 09:37:01 EDT
Problem is back again. How to solve this?