Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 525804

Summary: Ensure compatibility with Eclipse Photon
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: laurent.fasani
Version: 5.1.0Keywords: triaged
Target Milestone: 6.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/112655
https://git.eclipse.org/r/114431
https://git.eclipse.org/r/114474
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=63b690bfae765153ad3ce1543bcf794566de60b3
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=88150637ace43fa5e9584466acd2d993d230e919
https://git.eclipse.org/r/121120
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=1cd5fe7cc21325c38a16d3ddf91521afbf692e3b
https://git.eclipse.org/r/122552
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4d1d9a9dd1f6293925b67fdb54c85619cd30cc05
Whiteboard:
Bug Depends on: 531667    
Bug Blocks:    
Attachments:
Description Flags
RefreshWithCustomizedStyleTests.testLabelSizeCustomization with Photon M5
none
RefreshWithCustomizedStyleTests.testLabelSizeCustomization with Photon M6
none
Graphical issues on Sirius diagrams with Photon M6 and Gtk2
none
Sample broken Sirius diagram drawing with Photon M6 / GTK3
none
Fixed diagram after reverting https://git.eclipse.org/r/c/118410/ in SWT none

Description Pierre-Charles David CLA 2017-10-10 04:24:03 EDT
Sirius 6.0 will be released as part of Eclipse Photon in June 2018. This is a "master issue" for all concrete tasks and fixes that will be needed to ensure we are compatible.

This includes, at the very least:
* having an up-to-date Photon-based target platform and build;
* making sure our test suites are regularly executed on that Photon target as soon as possible;
* identify, report and help fix any issue in upstream components as soon as possible;
* identify and fix any change needed in Sirius itself.

Note that Sirius 6.0 will still need to be compatible with Eclipse Oxygen in addition to Photon.
Comment 1 Eclipse Genie CLA 2017-11-30 12:06:54 EST
New Gerrit change created: https://git.eclipse.org/r/112655
Comment 2 Eclipse Genie CLA 2017-12-19 11:49:46 EST
New Gerrit change created: https://git.eclipse.org/r/114431
Comment 3 Eclipse Genie CLA 2017-12-20 07:15:30 EST
New Gerrit change created: https://git.eclipse.org/r/114474
Comment 4 Pierre-Charles David CLA 2018-01-30 08:59:48 EST
See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=530506 which may require some adaptation on our side.
Comment 7 Pierre-Charles David CLA 2018-03-09 05:22:20 EST
We have a Photon-based Target Platform, with corresponding builds and test jobs. For now this has not revealed anything scary.
Comment 8 Pierre-Charles David CLA 2018-03-20 08:50:03 EDT
Created attachment 273215 [details]
RefreshWithCustomizedStyleTests.testLabelSizeCustomization with Photon M5
Comment 9 Pierre-Charles David CLA 2018-03-20 08:50:22 EDT
Created attachment 273216 [details]
RefreshWithCustomizedStyleTests.testLabelSizeCustomization with Photon M6
Comment 10 Pierre-Charles David CLA 2018-03-20 09:15:59 EDT
We've noticed some very bad graphical regressions on Sirius diagrams when moving from Photon M5 to Photon M6.

The attached screenshots are automated screenshots taken during our SWTbot-based tests in two successive runs. Both use a Photon-based target platform, and both were using the exact same Sirius source code (ba857a4821e33f1f559cb825cff7483d95ec133c; they are triggered every night).

The first is from right before M6 was published, and used:

  org.eclipse.swt 3.107.0.v20180124-1904 (commitId=be67e7a453048309b3d338b0f6f24c60f69e6f1a)

The second is right after M6 was published, and used

  org.eclipse.swt 3.107.0.v20180308-0607 (commitId=59c2b8fb0e89d261ae4e11c259b1902b74a058b1)

Everything is identical between the two runs, except for the target platform, which resolved to M5 vs M6.

The machine is a Linux and uses GTK3:

  org.eclipse.swt.internal.gtk.theme=Adwaita
  org.eclipse.swt.internal.gtk.version=3.14.5

As can be seen there are very bad graphical "glitches" with parts of the GEF canvas drawn outside of the editor.

We tried to reproduce the problemn locally, and indeed something is very wrong. It's not yet completely clear what because we get different symptoms on different machines and with different settings (SWT_GTK3=0 or 1).

- On my machine (up-to-date Debian 9) SWT_GTK3=1 uses Gtk 3.22.11, and I could not reproduce any issue manually.
- On a very similar machine (up-to-date Debian 9, SWT_GTK3=1 and Gtk 3.22.11 also), Florian has several issues, which can can be summed up as "different parts of the graphical stack use different coordinate systems". For example to select an element on a diagram with the mouse, one has to click around (100,100) pixels below and to the right compared to position the element is drawn. Some element's shadows also seem shifted by a similar amount. Florian also can reproduce the same kind of glitches that are visible on the attached screenshots: after scrolling the diagram editor, sometimes parts of the diagram are drawn outside of the editor are on top of the main Eclipse UI, and then stay there forever.
- On my machine, when forcing the use of Gtk 2 (2.24.31), I have a different kind of issue. I'll post a video, it's easier than trying to explain it with words.

Note that we could reproduce similar issues with non-Sirius plain GMF examples (Logic Diagram), so it does not seem to be caused by Sirius and may affect other GMF-based projects, or even anything using GEF Legacy.
Comment 11 Pierre-Charles David CLA 2018-03-20 09:19:09 EDT
Created attachment 273219 [details]
Graphical issues on Sirius diagrams with Photon M6 and Gtk2

Basically, when scrolling the diagram some parts are redrawn in a broken way and, in this case, the content of the palette (which is part of the editor but not of the main drawing area) are wrongly copied inside the diagram.
Comment 12 Pierre-Charles David CLA 2018-03-20 09:44:10 EDT
(In reply to Pierre-Charles David from comment #11)
> Created attachment 273219 [details]
> Graphical issues on Sirius diagrams with Photon M6 and Gtk2
> 
> Basically, when scrolling the diagram some parts are redrawn in a broken way
> and, in this case, the content of the palette (which is part of the editor
> but not of the main drawing area) are wrongly copied inside the diagram.

It seems that this particular issue with Gtk2 was already present with Photon M5: the runtime where I reproduce it uses org.eclipse.swt (3.107.0.v20180124-1904), which matches the version from M5 where the other issues were not yet present. I guess this is "normal" as Gtk 2.24 is part of the older versions that SWT does not support anymore. It's a little strange that we did not see it before, but we usually use Neon or Oxygen as our default TP to make sure we don't break compat with them, so it's very possible that nobody noticed until now that we are specifically looking at this.
Comment 13 Pierre-Charles David CLA 2018-03-20 10:02:51 EDT
(In reply to Pierre-Charles David from comment #10)
> - On my machine (up-to-date Debian 9) SWT_GTK3=1 uses Gtk 3.22.11, and I
> could not reproduce any issue manually.

I can reproduce it now. On my first test I was using a diagram which has an explicit background color (see #525533), and for some reason the problem does not appear then. However when using an Ecore Tools diagram, with a plain white background (or more precisely, no background color / transparent figure), I can indeed reproduce. At least this eliminates the unexplained difference between my machine and Florian's, which both use the same versions of everything.
Comment 14 Pierre-Charles David CLA 2018-03-20 10:47:32 EDT
Created attachment 273224 [details]
Sample broken Sirius diagram drawing with Photon M6 / GTK3

The attached screenshot corresponds to the main issue, reproduced with Gtk3 and Photon M6.

Things to note:
- to select the "NewClass1" I had to click far below and to the right of the visible shape.
- the "Sirius Debugging View" shows some interesting internal information on the currently select element. In this cas it shows the logical coordinates of the element as defined in the GMF Notation model used underneath and the Draw2D pĥysical coordinates (i.e. the IFigure.getBounds()). In this case the selected element is a top-level element, so they are the same: (657, 245).
- I've made visible the diagram ruler (the unit is the pixel), which shows that the viewport is at the logical origin of the diagram (0,0). Zoom is at 100%.
- Given the two points above, we would expect the "NewClass1" to be drawn at (657, 245), which is actually the place I had to click to select it. However, measuring on the image we are at something like (242, 90) from the origin of the canvas inside the editor.
- A second measure from the origin *of the top-level shell* (i.e. top-left corner right above the "File" menu, not considering the window decoration) to the top-left corner of "NewClass1" give *exactly* (657, 245).

My interpretation is that part of the graphical stack wrongly uses the origin of the top-level shell for its drawing operations instead of the origin of the canvas widget. This may be related to https://git.eclipse.org/r/c/118410/, which was merged between M5 and M6: the commit message mentions

  "The clipping region was not computed properly, due to transformations
  done with the device space transformation matrix provided by Cairo. From
  GTK 3.10 onward, this matrix contains absolute coordinates of the
  widget, with respect to the shell."

I don't know if this commit in particular is the cause of what we see, but it is clearly about the same kind of issues.
Comment 15 Pierre-Charles David CLA 2018-03-20 11:54:27 EDT
Created attachment 273227 [details]
Fixed diagram after reverting https://git.eclipse.org/r/c/118410/ in SWT

Reverting https://git.eclipse.org/r/c/118410/ (commit e78489ee67784eb3704ba210de1effcb777e0126) seems to fix this particular issue: see the result in the attached screenshot. I have no idea on the possible negative impacts of a complete revert, but this seems to confirm that particular change is the cause of the regression on our side.
Comment 16 Eclipse Genie CLA 2018-04-13 03:40:55 EDT
New Gerrit change created: https://git.eclipse.org/r/121120
Comment 18 Eclipse Genie CLA 2018-05-14 02:47:33 EDT
New Gerrit change created: https://git.eclipse.org/r/122552
Comment 20 Pierre-Charles David CLA 2018-06-05 02:32:10 EDT
No open Photon-specific issues have been identified.
Comment 21 Laurent Redor CLA 2018-06-27 11:55:49 EDT
Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details