The dummy video driver check is now covered by explicitly checking for cocoa above.
authorSam Lantinga <slouken@libsdl.org>
Tue, 29 Aug 2017 22:24:59 -0700
changeset 114231d6cabc7ac23
parent 11422 243b1a53ad89
child 11424 976664617115
The dummy video driver check is now covered by explicitly checking for cocoa above.
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Tue Aug 29 22:04:43 2017 -0700
     1.2 +++ b/src/video/SDL_video.c	Tue Aug 29 22:24:59 2017 -0700
     1.3 @@ -1184,28 +1184,26 @@
     1.4          if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)
     1.5              return 0;
     1.6      
     1.7 -        if (!_this->is_dummy) {
     1.8 -            /* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
     1.9 -            if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
    1.10 -                if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) {
    1.11 -                    return -1;
    1.12 -                }
    1.13 -            } else if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)) {
    1.14 -                display = SDL_GetDisplayForWindow(window);
    1.15 -                SDL_SetDisplayModeForDisplay(display, NULL);
    1.16 -                if (_this->SetWindowFullscreen) {
    1.17 -                    _this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
    1.18 -                }
    1.19 +        /* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
    1.20 +        if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
    1.21 +            if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) {
    1.22 +                return -1;
    1.23              }
    1.24 -
    1.25 -            if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
    1.26 -                if (Cocoa_IsWindowInFullscreenSpace(window) != fullscreen) {
    1.27 -                    return -1;
    1.28 -                }
    1.29 -                window->last_fullscreen_flags = window->flags;
    1.30 -                return 0;
    1.31 +        } else if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)) {
    1.32 +            display = SDL_GetDisplayForWindow(window);
    1.33 +            SDL_SetDisplayModeForDisplay(display, NULL);
    1.34 +            if (_this->SetWindowFullscreen) {
    1.35 +                _this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
    1.36              }
    1.37          }
    1.38 +
    1.39 +        if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
    1.40 +            if (Cocoa_IsWindowInFullscreenSpace(window) != fullscreen) {
    1.41 +                return -1;
    1.42 +            }
    1.43 +            window->last_fullscreen_flags = window->flags;
    1.44 +            return 0;
    1.45 +        }
    1.46      }
    1.47  #elif __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10)
    1.48      /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen