Fix closing of GLMakie windows on Mac #2553
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #393, fixes #482, fixes #658, fixes #682
I always suspected that windows not closing were an issue of glfw on Mac, given that it always seemed to work ok on Linux and Windows. There actually is a problem with glfw as it was explained to me here glfw/glfw#1766 (comment) but following down that trail I noticed that it is a separate issue from windows not disappearing at all. The stuck process, which is really what the glfw issue is about, is not so bad for user experience, because it doesn't get in the way (unlike stuck windows). So I once more followed the chain of events that happen when the x button is pressed on the window:
scene.events.window_open
observable is set tofalse
close
on it. Why this worked on Linux and Windows I don't know.close
does the stuff that actually hides a window..close
actually also setswindow_open[] = false
. To avoid an infinite loop, I put this behind a check. Not sure if this would actually need to be removed, but I'm not sure when elseclose
could be called so it seems better to leave it in.Hopefully this doesn't conflict with Linux and Windows behavior and settles that annoying issue once and for all.
Type of change
Delete options that do not apply: