Bug 442136 - Sirius Specification Editor inverts UI colors
Summary: Sirius Specification Editor inverts UI colors
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 5.0.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 451498 (view as bug list)
Depends on: 376936 435536
Blocks:
  Show dependency tree
 
Reported: 2014-08-20 04:15 EDT by Christian Pontesegger CLA
Modified: 2021-06-13 08:17 EDT (History)
7 users (show)

See Also:


Attachments
screenshot (5.93 KB, image/png)
2014-08-20 04:15 EDT, Christian Pontesegger CLA
no flags Details
Screen shot of balnk editor (16.98 KB, image/png)
2014-08-29 12:56 EDT, Phil Beauvoir CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Pontesegger CLA 2014-08-20 04:15:55 EDT
Created attachment 246155 [details]
screenshot

The Sirius specification editor sometimes inverts colors quite strange (see attachment).

Steps to reproduce:

1) open sirius Specification editor
2) select one tree element
3) switch focus to another viewpart
4) click mouse on the still highlighted element in the spec. editor
Comment 1 Laurent Redor CLA 2014-08-21 03:06:58 EDT
Problem reproduced on Windows 7 with Sirius 1.0.1 (Luna) but not on Linux (Juno3 or Luna) nor on Mac (Kepler). This problem seems specific to Windows (only tested on Windows 7).

Workaround: Put the mouse over "invisible" items reveal it.
Comment 2 Laurent Redor CLA 2014-08-21 03:26:55 EDT
We have the same problem with a simple ecore editor example, but not with the Sample Ecore Model Editor.

The VSM (specification) editor and the simple ecore editor example are not generated with the last version of EMF. We must try to regenerate it to see if this resolves the problem.
Comment 3 Phil Beauvoir CLA 2014-08-29 12:56:09 EDT
Created attachment 246555 [details]
Screen shot of balnk editor

I am seeing this on Windows 8.1 in Luna 4.4.

This can be reproduced 100% by selecting a tree node and then putting the focus on the Properties View in Eclipse and then reselecting the tree node.
Comment 4 Christian Pontesegger CLA 2014-08-30 07:31:18 EDT
seems to be a bigger issue as I see this in git staging view, too. Will raise a bug against platform/UI and link from here.
Comment 5 Phil Beauvoir CLA 2014-08-30 08:17:25 EDT
(In reply to Christian Pontesegger from comment #4)
> seems to be a bigger issue as I see this in git staging view, too. Will
> raise a bug against platform/UI and link from here.

Yes, I'm seeing it on git staging view, too.
Comment 6 Phil Beauvoir CLA 2014-08-31 05:37:10 EDT
I've been doing some detective work on this.

The problem is more obvious when you click on the tree in the Sirius Editor with a mouse click held for a slightly longer time. This suggests to me that something strange is happening with drag and drop.

So, in the org.eclipse.sirius.editor.editorPlugin.SiriusEditor, in the methd:

protected void createContextMenuFor(StructuredViewer viewer)

if you comment out or remove this line:

viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));

The color problem does not occur.

I don't think that ViewerDragAdapter is the problem. I think the problem area is in the fact that drag support has been registered in the Viewer. But I don't know why this is like this.
Comment 7 Christian Pontesegger CLA 2014-09-01 09:07:56 EDT
raised platform/UI bug 443013
Comment 8 Laurent Redor CLA 2014-09-01 09:15:05 EDT
Thanks you for your analysis, we will follow this platform bug closely
Comment 9 Esteban DUGUEPEROUX CLA 2014-11-14 08:02:24 EST
*** Bug 451498 has been marked as a duplicate of this bug. ***
Comment 10 Eclipse Genie CLA 2017-02-06 05:54:09 EST
New Gerrit change created: https://git.eclipse.org/r/90402
Comment 11 Pierre Guilet CLA 2017-02-06 10:00:33 EST
The problem with the VSM editor is link to the following combination : 

- We use an EMF ViewPane using a SWT ViewForm encapsulating a JFace TreeViewer referencing a Tree with SWT.MULTI flag. 
- And the TreeViewer has the drag and drop support activated by using org.eclipse.jface.viewers.StructuredViewer.addDropSupport(int, Transfer[], DropTargetListener)  

Not using the SWT.MULTI flag on not using the drag and drop support or not using the ViewPane make it work.

I did a draft were the bug is gone without loosing drag and drop or multi-selection : https://git.eclipse.org/r/#/c/90402/

I use in this patch the same construction than the EcoreEditor were no ViewPane is used.

But we loose all other functionalities linked to the CustomSiriusEditor that is not used in the patch.

I seems to me that it is an UI platform bug so I opened a ticket :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=511769
Comment 12 Eclipse Genie CLA 2017-05-04 08:20:45 EDT
New Gerrit change created: https://git.eclipse.org/r/96393
Comment 13 Pierre-Charles David CLA 2017-05-09 05:09:49 EDT
(In reply to Eclipse Genie from comment #12)
> New Gerrit change created: https://git.eclipse.org/r/96393

This is a workaround based on https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=052d5d66f0a1b483abcc639dc36dfb9820a326dc. It seems to "fix" the issue on the machines we tested it on. It's not perfect, there's a short visible "flash" when the tree is redrawn, but it's better than before. It does not seem to cause visible regressions when a different element than before is selected in the tree.
Comment 15 Pierre-Charles David CLA 2017-05-12 03:21:20 EDT
Should be fixed by fb0ec5ffc52dd0bb34bacb9e4662b03b04b0687f. It's difficult to be completely sure as the bug can not always be reproduced, but I've merged the patch anyway; having it in M7 will make it easier to verify on the maximum number of machines.
Comment 16 Jessy Mallet CLA 2017-05-15 09:11:22 EDT
Validated with Sirius 5.0.0.201705121003
Comment 17 Pierre-Charles David CLA 2017-05-17 03:20:18 EDT
Verified by Jessy.
Comment 18 Pierre-Charles David CLA 2017-06-29 03:33:26 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.