@@ -1199,21 +1199,27 @@ - (void)windowDidResize:(NSNotification *)aNotification
1199
1199
1200
1200
ScheduleContextUpdates (_data);
1201
1201
1202
- /* isZoomed always returns true if the window is not resizable
1203
- * and fullscreen windows are considered zoomed .
1202
+ /* The OS can resize the window automatically if the display density
1203
+ * changes while the window is miniaturized or hidden .
1204
1204
*/
1205
- if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed ] &&
1206
- !(window->flags & SDL_WINDOW_FULLSCREEN) && ![self isInFullscreenSpace ]) {
1207
- zoomed = YES ;
1208
- } else {
1209
- zoomed = NO ;
1210
- }
1211
- if (!zoomed) {
1212
- SDL_SendWindowEvent (window, SDL_EVENT_WINDOW_RESTORED, 0 , 0 );
1213
- } else {
1214
- SDL_SendWindowEvent (window, SDL_EVENT_WINDOW_MAXIMIZED, 0 , 0 );
1215
- if ([self windowOperationIsPending: PENDING_OPERATION_MINIMIZE]) {
1216
- [nswindow miniaturize: nil ];
1205
+ if ([nswindow isVisible ])
1206
+ {
1207
+ /* isZoomed always returns true if the window is not resizable
1208
+ * and fullscreen windows are considered zoomed.
1209
+ */
1210
+ if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed ] &&
1211
+ !(window->flags & SDL_WINDOW_FULLSCREEN) && ![self isInFullscreenSpace ]) {
1212
+ zoomed = YES ;
1213
+ } else {
1214
+ zoomed = NO ;
1215
+ }
1216
+ if (!zoomed) {
1217
+ SDL_SendWindowEvent (window, SDL_EVENT_WINDOW_RESTORED, 0 , 0 );
1218
+ } else {
1219
+ SDL_SendWindowEvent (window, SDL_EVENT_WINDOW_MAXIMIZED, 0 , 0 );
1220
+ if ([self windowOperationIsPending: PENDING_OPERATION_MINIMIZE]) {
1221
+ [nswindow miniaturize: nil ];
1222
+ }
1217
1223
}
1218
1224
}
1219
1225
0 commit comments