one last SDL fix: restore menu bar if we destroy a fullscreen window without transitioning it back to a non-fullscreen window first
authorSam Lantinga <slouken@libsdl.org>
Mon, 09 Nov 2015 08:55:07 -0800
changeset 99072048ad756970
parent 9906 49c432b1897b
child 9908 b63158b01a7d
one last SDL fix: restore menu bar if we destroy a fullscreen window without transitioning it back to a non-fullscreen window first
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon Nov 09 08:55:01 2015 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Nov 09 08:55:07 2015 -0800
     1.3 @@ -641,7 +641,11 @@
     1.4  - (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
     1.5  {
     1.6      SDL_Window *window = _data->window;
     1.7 -    
     1.8 +
     1.9 +    if (window->is_destroying) {
    1.10 +        return;
    1.11 +    }
    1.12 +
    1.13      SetWindowStyle(window, GetWindowStyle(window));
    1.14  
    1.15      isFullscreenSpace = NO;
    1.16 @@ -688,6 +692,10 @@
    1.17  {
    1.18      SDL_Window *window = _data->window;
    1.19      
    1.20 +    if (window->is_destroying) {
    1.21 +        return;
    1.22 +    }
    1.23 +
    1.24      SetWindowStyle(window, (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask));
    1.25      
    1.26      isFullscreenSpace = YES;
    1.27 @@ -1648,6 +1656,9 @@
    1.28      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    1.29  
    1.30      if (data) {
    1.31 +        if ([data->listener isInFullscreenSpace]) {
    1.32 +            [NSMenu setMenuBarVisible:YES];
    1.33 +        }
    1.34          [data->listener close];
    1.35          [data->listener release];
    1.36          if (data->created) {