Bug 526694 - Generated tree editor view turns blue when clicking on already selected line coming from distinct window
Summary: Generated tree editor view turns blue when clicking on already selected line ...
Status: CLOSED DUPLICATE of bug 376936
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-31 12:47 EDT by Joachim Anlauf CLA
Modified: 2020-08-14 04:47 EDT (History)
3 users (show)

See Also:


Attachments
pdf file with screen shots and some additional remarks (452.13 KB, application/pdf)
2017-10-31 12:47 EDT, Joachim Anlauf CLA
no flags Details
Screen capture showing repaint problem (19.11 KB, image/png)
2017-11-01 07:53 EDT, Ed Merks CLA
no flags Details
Plugin project that demonstrates similar issue with FilteredTree (20.40 KB, application/x-zip-compressed)
2020-08-03 03:56 EDT, Roy Stoliday CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Anlauf CLA 2017-10-31 12:47:06 EDT
Created attachment 271272 [details]
pdf file with screen shots and some additional remarks

Hi,
I am reporting a long known bug, but can give some new hints for reproducing the bug.

If a line in the generated tree editor is selected and you move the focus to a different view in the eclipse environment and you click with the mouse onto the same already selected line in the generated tree editor, all other lines of the tree disappear behind a light blue area (the same blue as the frame of a selected view). The bug does not show up if you come back from a different view by clicking on a not already selected line in the tree editor. Some people that knew about the bug have had the impression that the bug is not reproducible, but it is. You simply have to click the same line again, when you come back to the tree editor.

The light blue lines reappear, if you click on a different view again or if you move your mouse over the regions of the tree view, where data normally should be visible.

I am pretty sure that I observed the same behaviour in other standard tree editors before, but I did not pay attention for some time. In eclipse Oxygen.1 running on Windows 10 I was not able to reproduce this behavior in the standard tree editors, but it is still there in the generated tree editor, generated with EMF. Due to discussions on EclipseCon Europe 2017 I am pretty sure that the bug only appears on Windows, not on Apple or Linux, but I did not check it myself.

You can reproduce the bug with a generated editor for even the simplest meta model. In the the screen shots a have added to this bug report I have used a freshly downloaded eclipse modeling package, an ecore model consisting of a single class with a single attribute. The generated editor has not been touched at all, it consists of the original generated source code.

In my opinion this is a bug in SWT, but since I could reproduce it with the generated tree editor only, I file the bug report under EMF edit.

Although this bug is not a serious one, it is annoying, especially if you present your tools to customers.
Comment 1 Ed Merks CLA 2017-11-01 07:48:38 EDT
There are a number of places where I can reproduce the same type of redraw behavior.

Here's another way.  Open any plugin.xml that contains extensions in PDE's editor.  Turn to the Extensions tab, and expand the extension and then select a child tree item.  Given focus to any other view by clicking on the view tab.  Give focus to some other window.  Select the already-selected tree item from before.
Comment 2 Ed Merks CLA 2017-11-01 07:53:16 EDT
Created attachment 271284 [details]
Screen capture showing repaint problem

In this case the problem is reproduced in the PDE editor. I can also reproduce this problem in the Git staging view.

Generally the problem appears to be an interaction between the focus handling/changing and the non-custom painting of a tree. 

I.e., select a tree item is some view or editor, give focus to some other view, give focus to some other window entirely, and finally give focus back to the original tree item by directly selecting that already-selected item.

Unfortunately I was unable to reproduce this with a simple pure SWT test case but I believe this is purely an SWT problem.
Comment 3 Pierre-Charles David CLA 2017-11-02 04:05:31 EDT
This looks similar to bug #442136 (and #513389) that hit us in Sirius (in an EMF-generated editor also). We "fixed" it with this change: https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fb0ec5ffc52dd0bb34bacb9e4662b03b04b0687f adapted from https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=052d5d66f0a1b483abcc639dc36dfb9820a326dc.

The root issue seems to be https://bugs.eclipse.org/bugs/show_bug.cgi?id=435536, but it was closed as INVALID.
Comment 4 Eclipse Genie CLA 2020-04-25 17:02:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Rolf Theunissen CLA 2020-07-23 02:26:14 EDT
The issue is still not fixed, observe it myself regularly.

Reported again in the forum (including reproduction example):
https://www.eclipse.org/forums/index.php?t=rview&goto=1830259#msg_1830259
Comment 6 Roy Stoliday CLA 2020-08-03 03:56:40 EDT
Created attachment 283784 [details]
Plugin project that demonstrates similar issue with FilteredTree

Rolf recommended I add the source code for the FilteredTree example mentioned in the community forum issue.
https://www.eclipse.org/forums/index.php/m/1830259/#msg_1830259
Comment 7 Rolf Theunissen CLA 2020-08-10 02:30:50 EDT
The observed behavior is consistent with a comment in Tree [1], that describes 'Feature in Windows'. It has a 'workaround' in place for that. Apparently, the implemented fix is not working in a specific case, not not at all (anymore).

[1] org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(long, long) line 6550
Comment 8 Rolf Theunissen CLA 2020-08-11 14:19:24 EDT
Basically, the workaround for Bug 180482 causes this behavior (on newer windows versions?).
Comment 9 Eclipse Genie CLA 2020-08-11 14:48:13 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/167548
Comment 10 Rolf Theunissen CLA 2020-08-14 04:47:29 EDT

*** This bug has been marked as a duplicate of bug 376936 ***