@@ -543,6 +543,8 @@ -(void) viewDidEndLiveResize
543
543
ALLEGRO_INFO (" Window finished resizing %d x %d \n " , event.display .width , event.display .height );
544
544
}
545
545
_al_event_source_unlock (es);
546
+ dpy->old_w = NSWidth (content);
547
+ dpy->old_h = NSWidth (content);
546
548
}
547
549
/* Window switch in/out */
548
550
-(void ) windowDidBecomeMain : (NSNotification *) notification
@@ -1512,6 +1514,8 @@ static void init_new_vsync(ALLEGRO_DISPLAY_OSX_WIN *dpy)
1512
1514
#endif
1513
1515
display->w = w;
1514
1516
display->h = h;
1517
+ dpy->old_w = w;
1518
+ dpy->old_h = h;
1515
1519
_al_event_source_init (&display->es );
1516
1520
_al_osx_change_cursor (dpy, [NSCursor arrowCursor ]);
1517
1521
dpy->show_cursor = YES ;
@@ -2072,6 +2076,10 @@ static bool resize_display_win(ALLEGRO_DISPLAY *d, int w, int h)
2072
2076
});
2073
2077
// must be done on the thread the user calls it from, not the main thread
2074
2078
setup_gl (d);
2079
+ // Only update the old values in response to user-initiated resizes.
2080
+ ALLEGRO_DISPLAY_OSX_WIN *dpy = (ALLEGRO_DISPLAY_OSX_WIN *)d;
2081
+ dpy->old_w = w;
2082
+ dpy->old_h = h;
2075
2083
return rc;
2076
2084
}
2077
2085
@@ -2458,7 +2466,7 @@ static bool set_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
2458
2466
display->flags |= ALLEGRO_MAXIMIZED;
2459
2467
else
2460
2468
display->flags &= ~ALLEGRO_MAXIMIZED;
2461
- [dpy-> view maximize ];
2469
+ [view maximize ];
2462
2470
break ;
2463
2471
case ALLEGRO_FULLSCREEN_WINDOW:
2464
2472
if (onoff) {
@@ -2471,12 +2479,8 @@ static bool set_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
2471
2479
display->flags |= ALLEGRO_FULLSCREEN_WINDOW;
2472
2480
} else {
2473
2481
[view exitFullScreenWindowMode ];
2474
- NSRect sc = [view frame ];
2475
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2476
- sc = [win convertRectToBacking: sc];
2477
- #endif
2478
2482
display->flags &= ~ALLEGRO_FULLSCREEN_WINDOW;
2479
- resize_display_win_main_thread (display, sc. size . width , sc. size . height );
2483
+ resize_display_win_main_thread (display, dpy-> old_w , dpy-> old_h );
2480
2484
[view finishExitingFullScreenWindowMode ];
2481
2485
}
2482
2486
need_setup_gl = true ;
0 commit comments