Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling the tabs in the layout hides the contents of some Java2D displays #35

Open
lesquoyb opened this issue Jun 21, 2022 · 5 comments
Assignees
Labels
😱 Bug The issue reveals a bug in GAMA 📺 Display Java2D This issue or request concerns only Java2D displays

Comments

@lesquoyb
Copy link
Contributor

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:
image
If you run it as is, the first two displays do not show. Clicking on them makes them appear.

image
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

image
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 gama-platform/gama#3447
But if you comment the chart from a display you changed to opengl, then it will be displayed normally:

image

And everything seems to come from the tabs facet being false, as commenting it solves the problem

@AlexisDrogoul
Copy link
Member

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;

@AlexisDrogoul AlexisDrogoul self-assigned this Jun 26, 2022
@AlexisDrogoul AlexisDrogoul changed the title Disabling the tabs in certain layout hide the content of certain display Disabling the tabs in the layout hides the contents of some Java2D displays Jul 18, 2022
@lesquoyb
Copy link
Contributor Author

@AlexisDrogoul the recent changes in eclipse/swt changed a bit the final result, but didn't fix it, do you think it's fixable in a short amount of time ?
Else we could temporarily go for a warning when setting tabs to false and force opengl on the library models so at least the next release is "clean"

@lesquoyb
Copy link
Contributor Author

I added back the tabs in the library models that were having that issue in my last commit, we'll need to remove them again once the issue fixed.
Note: I noticed that the problem was not happening in 1.8.2-RC1, so probably something introduced with the big changes in displays between RC1 and RC2 (like the sync statement becoming global for example)

@AlexisDrogoul
Copy link
Member

@AlexisDrogoul the recent changes in eclipse/swt changed a bit the final result, but didn't fix it, do you think it's fixable in a short amount of time ?
Else we could temporarily go for a warning when setting tabs to false and force opengl on the library models so at least the next release is "clean"

I have issued a commit that does exactly this. The warning is only active when a 2d display is detected in output or permanent (whether it is explicit or set by default in the preferences), in conjunction with tabs: false set in layout. And of course only on Windows.

@lesquoyb
Copy link
Contributor Author

Good enough for gama 1.9.0, leaving it open for later fix

@benoitgaudou benoitgaudou transferred this issue from gama-platform/gama.old Feb 21, 2024
@lesquoyb lesquoyb added 😱 Bug The issue reveals a bug in GAMA 📺 Display Java2D This issue or request concerns only Java2D displays labels Mar 22, 2024
@lesquoyb lesquoyb removed this from GAMA 2024-11 Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😱 Bug The issue reveals a bug in GAMA 📺 Display Java2D This issue or request concerns only Java2D displays
Projects
None yet
Development

No branches or pull requests

2 participants