don't toggle SDL fullscreen state on OSX if we're destroying the window
authorSam Lantinga <slouken@libsdl.org>
Mon, 09 Nov 2015 08:55:01 -0800
changeset 990649c432b1897b
parent 9905 fcf85090f816
child 9907 2048ad756970
don't toggle SDL fullscreen state on OSX if we're destroying the window
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Mon Nov 09 08:54:56 2015 -0800
     1.2 +++ b/src/video/SDL_video.c	Mon Nov 09 08:55:01 2015 -0800
     1.3 @@ -1138,6 +1138,12 @@
     1.4          return 0;
     1.5  
     1.6  #ifdef __MACOSX__
     1.7 +    /* if the window is going away and no resolution change is necessary,
     1.8 +     do nothing, or else we may trigger an ugly double-transition
     1.9 +     */
    1.10 +    if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)
    1.11 +        return 0;
    1.12 +    
    1.13      /* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
    1.14      if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
    1.15          if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) {