gama.old
gama.old copied to clipboard
Disabling the tabs in the layout hides the contents of some Java2D displays
Describe the bug
When using the layout statement, having the facet tabs set at false give some strange behaviours.
Here an example with the heatmap.gaml model from Library Models:
If you run it as is, the first two displays do not show. Clicking on them makes them appear.
Same with the vertical layout. If you click on a display it will appear, but if you then click on another display, the new one will appear and the previous one disappear
with an horizontal layout it's the 3 first display that do not work. As with the vertical layout, clicking on a display will make it appear, but in addition it will make disappear the only one that appeared in the initialisation.
The stack layout is exactly as the horizontal one (which is probably normal with the tabs disabled).
If you change one non-working display to an opengl one it will crash gama with the same error message as in #3447 But if you comment the chart from a display you changed to opengl, then it will be displayed normally:

And everything seems to come from the tabs facet being false, as commenting it solves the problem
When tabs are hidden, Eclipse considers views to be in a somewhat strange status. Somewhere between the normal status and the "detached" status. As a matter of fact, it is not considered a "correct" state. From my observation, on all OSes, it seems that a hidden event is (wrongly) sent to the last opened view whenever a new one is selected. Now, on macOS and Linux, this event is immediately followed by a show event (probably due to the layout resizing or something similar) ... but for some reason, not on Windows. This does not affect OpenGL displays, because we manually manage whether OpenGL surfaces are hidden or not in response to hide/show events (allowing to "filter out" bad events), but I still havent found how to catch or revert the wrong event on Windows in case of Java2D displays;