Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SmithTom6304
Copy link

Description

On mac, the SDL_cocoawindow observeValueForKeyPath callback generates a SDL_WINDOWEVENT_SHOWN event before the SDL_WINDOWEVENT_RESTORED gets generated. SDL_WINDOWEVENT_SHOWN unsets the SDL_WINDOW_MINIMIZED flag; this in turn causes SDL_WINDOWEVENT_RESTORED event to return before being posted, as the window is neither minimized or maximized.
I also considered calling SDL_SendWindowEvent() from observeValueForKeyPath in SDL_cocoawindow just before we call SendWindowEvent for SDL_WINDOWEVENT_SHOWN - this also fixes the bug, but results in SDL_WINDOWEVENT_RESTORED being generated twice, with the second time returning early due to the window no longer being minimized.

On mac, the SDL_cocoawindow observeValueForKeyPath callback generates a SDL_WINDOWEVENT_SHOWN event before the SDL_WINDOWEVENT_RESTORED gets generated. SDL_WINDOWEVENT_SHOWN unsets the SDL_WINDOW_MINIMIZED flag; this in turn causes SDL_WINDOWEVENT_RESTORED event to return before being posted, as the window is neither minimized or maximized.
I also considered calling SDL_SendWindowEvent() from observeValueForKeyPath in SDL_cocoawindow just before we call SendWindowEvent for SDL_WINDOWEVENT_SHOWN - this also fixes the bug, but results in SDL_WINDOWEVENT_RESTORED being generated twice, with the second time returning early due to the window no longer being minimized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants