src/video/SDL_video.c
changeset 12711 60b397c49d36
parent 12710 6c510e7c6884
child 12736 d3421eeb57a0
     1.1 --- a/src/video/SDL_video.c	Mon Apr 22 16:25:49 2019 -0700
     1.2 +++ b/src/video/SDL_video.c	Mon Apr 22 16:34:42 2019 -0700
     1.3 @@ -2207,6 +2207,15 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +static SDL_bool
     1.8 +CanMinimizeWindow(SDL_Window * window)
     1.9 +{
    1.10 +    if (!_this->MinimizeWindow) {
    1.11 +        return SDL_FALSE;
    1.12 +    }
    1.13 +    return SDL_TRUE;
    1.14 +}
    1.15 +
    1.16  void
    1.17  SDL_MinimizeWindow(SDL_Window * window)
    1.18  {
    1.19 @@ -2216,10 +2225,13 @@
    1.20          return;
    1.21      }
    1.22  
    1.23 +    if (!CanMinimizeWindow(window)) {
    1.24 +        return;
    1.25 +    }
    1.26 +
    1.27 +    SDL_UpdateFullscreenMode(window, SDL_FALSE);
    1.28 +
    1.29      if (_this->MinimizeWindow) {
    1.30 -        /* Only leave fullscreen mode if we're actually going to minimize */
    1.31 -        SDL_UpdateFullscreenMode(window, SDL_FALSE);
    1.32 -
    1.33          _this->MinimizeWindow(_this, window);
    1.34      }
    1.35  }