Don't flash the navigation bar when destroying a fullscreen SDL window
authorSam Lantinga <slouken@libsdl.org>
Mon, 08 Oct 2018 12:49:25 -0700
changeset 1230585c6aa0836d8
parent 12304 27ba030d839f
child 12306 094a25b0d812
Don't flash the navigation bar when destroying a fullscreen SDL window
src/video/android/SDL_androidwindow.c
     1.1 --- a/src/video/android/SDL_androidwindow.c	Mon Oct 08 12:49:23 2018 -0700
     1.2 +++ b/src/video/android/SDL_androidwindow.c	Mon Oct 08 12:49:25 2018 -0700
     1.3 @@ -102,14 +102,17 @@
     1.4  void
     1.5  Android_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
     1.6  {
     1.7 -    Android_JNI_SetWindowStyle(fullscreen);
     1.8 +    /* If the window is being destroyed don't change visible state */
     1.9 +    if (!window->is_destroying) {
    1.10 +        Android_JNI_SetWindowStyle(fullscreen);
    1.11 +    }
    1.12  
    1.13 -    // Ensure our size matches reality after we've executed the window style change.
    1.14 -    //
    1.15 -    // It is possible that we've set width and height to the full-size display, but on
    1.16 -    // Samsung DeX or Chromebooks or other windowed Android environemtns, our window may 
    1.17 -    // still not be the full display size.
    1.18 -    //
    1.19 +    /* Ensure our size matches reality after we've executed the window style change.
    1.20 +     *
    1.21 +     * It is possible that we've set width and height to the full-size display, but on
    1.22 +     * Samsung DeX or Chromebooks or other windowed Android environemtns, our window may 
    1.23 +     * still not be the full display size.
    1.24 +     */
    1.25      if (!SDL_IsDeXMode() && !SDL_IsChromebook()) {
    1.26          return;
    1.27      }