Skip to content

Commit e610529

Browse files
StrangePanKontrabant
authored andcommitted
Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize
1 parent 74df615 commit e610529

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/video/cocoa/SDL_cocoawindow.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,11 @@ - (void)windowDidResize:(NSNotification *)aNotification
855855
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
856856
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
857857

858+
/* The OS can resize the window automatically if the display density
859+
changes while the window is miniaturized or hidden */
860+
if (![nswindow isVisible])
861+
return;
862+
858863
/* isZoomed always returns true if the window is not resizable */
859864
if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) {
860865
zoomed = YES;

0 commit comments

Comments
 (0)