Bug 497929 - Eclipse IDE comes to front (but doesn't take focus) when moving mouse over SWT Tree widget
Summary: Eclipse IDE comes to front (but doesn't take focus) when moving mouse over SW...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.8.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.7 M4   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2016-07-14 13:48 EDT by Gerald Strait CLA
Modified: 2016-12-14 17:07 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Strait CLA 2016-07-14 13:48:36 EDT

    
Comment 1 Gerald Strait CLA 2016-07-14 13:59:16 EDT
Recreate using Eclipse 4.6 IDE for Java Developers

1. Download and install Eclipse 4.6 for Java Developers

2. Select Window>Show View>Other>Help>Help then select to view the Contents which displays the contents in a tree view.

3. Resize the Help view such that the tree items text can not fit int the Help view.  i.e. Such that the Help view is not wide enough to display the full text of all tree items.

4. Open Notepad such that you can still see the Eclipse IDE in the background with the Help view showing.

5. With Notepad as the application that has focus, move the mouse around over the Help view.  As you move the mouse the view attempts to display the full text of the tree item in the Help view in a little pop-up.  When that happens the Eclipse view sometimes gains focus from Notepad.  Note: Notepad is use just as an example, any other application could also be used rather than Notepad.
Comment 2 Dani Megert CLA 2016-07-19 03:50:01 EDT
Sarika, please have a look. I can reproduce using 4.6.
Comment 3 Sarika Sinha CLA 2016-07-19 04:19:13 EDT
I can see it happening it 4.5 and 3.8.1 as well.
After a while of moving mouse, the focus switches to Eclipse IDE.
Comment 4 Sarika Sinha CLA 2016-07-27 02:58:44 EDT
Another observation, this does not happen on Mac. I profile with Yourkit to understand what happens when we keep moving the mouse.It's all SWT code which take care of putting the focus back. 
I have added @Niraj for his comments.
Comment 5 Niraj Modi CLA 2016-08-23 03:28:43 EDT
(In reply to Sarika Sinha from comment #4)
> Another observation, this does not happen on Mac. I profile with Yourkit to
> understand what happens when we keep moving the mouse.It's all SWT code
> which take care of putting the focus back. 
> I have added @Niraj for his comments.

Sorry for the late reply, was busy with other set of issues in SWT.

Ok, initially I thought that Help page is 100% embedded browser HTML, but that's not the case. Only text content area looks like pure embedded browser showing the HTML, whereas the content index tree is a pure SWT Tree widget.

Spent some time reproducing the issue with SWT snippets and it can be reproduced with steps in comment1 using SWT ControlExample's Tree(but happens only when you keep moving the mouse over the tree for some time)

With initial investigation, narrowed down the problem to Tree's "SWT.FULL_SELECTION" style flag and not other Tree style options.
Comment 6 Markus Keller CLA 2016-08-23 06:32:03 EDT
I don't think FULL_SELECTION is relevant for this. The Help view from comment 1 doesn't use that flag, and the Debug view that frequently shows the same problem also doesn't use FULL_SELECTION.

Also note that the SWT app does not take focus -- it only comes to front.

*** This bug has been marked as a duplicate of bug 491627 ***
Comment 7 Markus Keller CLA 2016-11-28 13:58:22 EST
Reopening, doesn't seem to be a full dup of bug 491627, see bug 491627 comment 7.

https://git.eclipse.org/r/#/c/85763/2 fixes the problems with the Help, Debug, and Breakpoints views.

There's a remaining problem with Snippet15, but that's less severe, since it only appeared during testing so far.
Comment 9 Niraj Modi CLA 2016-11-29 02:58:38 EST
(In reply to Markus Keller from comment #7)
> Reopening, doesn't seem to be a full dup of bug 491627, see bug 491627
> comment 7.
> 
> https://git.eclipse.org/r/#/c/85763/2 fixes the problems with the Help,
> Debug, and Breakpoints views.
Markus, Thanks for verifying this in Eclipse.
I have pushed the latest patch to master, will consider this for back-port to 4.6.3

> There's a remaining problem with Snippet15, but that's less severe, since it
> only appeared during testing so far.
Yes agree.
Comment 10 Niraj Modi CLA 2016-12-07 06:28:12 EST
Verified in Eclipse Build ID: I20161205-2000 on Win7

Could reproduce the focus problem very rarely at my end with steps in comment 1, but once I ran Eclipse with '-clean' option I couldn't reproduce the problem any more.

Hi Gerald,
Can you please verify this fix at your end as well, Thanks!
Comment 11 Markus Keller CLA 2016-12-14 17:07:26 EST
I can confirm that it's less of a problem now for my use cases.

However, in I20161205-2000, the workspace window once came to front when I moved the mouse over the Debug view. I could not reproduce back then, but I can reproduce at will right now in I20161211-2000.

I've debugged the scenario from bug 491627 again, and I found a better fix, which I'll push in a minute. We should eventually backport the full fix from that bug.