Mac: Fix returning to the window's Space in OS X 10.11+ when SDL_WINDOW_FULLSCREEN_DESKTOP is used (bug #3152.)
authorAlex Szpakowski <slime73@gmail.com>
Fri, 23 Oct 2015 03:37:53 -0300
changeset 9897b9b4c1bbb778
parent 9896 b0b12a3c817c
child 9898 0da384bef562
Mac: Fix returning to the window's Space in OS X 10.11+ when SDL_WINDOW_FULLSCREEN_DESKTOP is used (bug #3152.)
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Thu Oct 15 22:26:21 2015 +0200
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Oct 23 03:37:53 2015 -0300
     1.3 @@ -1602,8 +1602,10 @@
     1.4      }
     1.5  
     1.6      if ( data && (window->flags & SDL_WINDOW_FULLSCREEN) ) {
     1.7 -        if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
     1.8 +        if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)
     1.9 +            && ![data->listener isInFullscreenSpace]) {
    1.10              /* OpenGL is rendering to the window, so make it visible! */
    1.11 +            /* Doing this in 10.11 while in a Space breaks things (bug #3152) */
    1.12              [data->nswindow setLevel:CGShieldingWindowLevel()];
    1.13          } else {
    1.14              [data->nswindow setLevel:kCGNormalWindowLevel];