Workaround for freeze on fullscreen under macOS #819
Closed
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.
Hi all ^ ^
On macOS 10.13.5, the TIC-80 window freezes when fullscreen mode is toggled. Reproducible with both official release and binary built from source.
Only the SDL backend has the problem, and I've traced down the issue to be an upstream issue reported in SDL bugzilla. In short, the Cocoa implementation of
SDL_PumpEvents()
has a weird behaviour — it may report "no events" during one call and find an event in the next (called in a row without any delay). This would result in some events not processed and thus freezing the SDL window.I suppose it's better to research a bit more and report it to SDL, but I have come up with a workaround for now. It's very simple, but it's inconvenient for me to confirm it doesn't break on other platforms, so please help with that. Thanks in advance!