mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 23:07:45 +08:00
Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize
(cherry picked from commit e610529e84)
This commit is contained in:
@@ -855,6 +855,11 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
|
|||||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
|
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
|
||||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
|
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
|
||||||
|
|
||||||
|
/* The OS can resize the window automatically if the display density
|
||||||
|
changes while the window is miniaturized or hidden */
|
||||||
|
if (![nswindow isVisible])
|
||||||
|
return;
|
||||||
|
|
||||||
/* isZoomed always returns true if the window is not resizable */
|
/* isZoomed always returns true if the window is not resizable */
|
||||||
if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) {
|
if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) {
|
||||||
zoomed = YES;
|
zoomed = YES;
|
||||||
|
|||||||
Reference in New Issue
Block a user