Skip to content

SDL2: Fix SDL_WINDOWEVENT_RESTORED firing on macOS if the window is still miniaturized during a resize #13408

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

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

StrangePan
Copy link
Contributor

@StrangePan StrangePan commented Jul 23, 2025

Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize

This is a backport of #13409 to SDL3

Description

Fixes SDL_WINDOWEVENT_RESTORED being sent to the application while the window is still miniaturized. This can happen if macOS resizes the window as a result of a display density change.

This can happen if the user changes their display resolution settings in System Preferences > Displays from the default on a retina display to 2x the default.

This can also happen if the user disconnects a non-retina display and the OS needs to move all application windows to another retina display.

In either case, any miniaturized windows will be resized accordingly while remaining miniaturized. SDL was treating all window resizes as if the window was visible and not miniaturized, which is not true.

@Kontrabant
Copy link
Contributor

Merged, thanks!

@Kontrabant Kontrabant merged commit e610529 into libsdl-org:SDL2 Jul 28, 2025
34 of 35 checks passed
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.

3 participants