From 4d771c598a9eaf14ab8fd666ec0030ae092629cf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 8 Oct 2018 12:49:25 -0700 Subject: [PATCH] Don't flash the navigation bar when destroying a fullscreen SDL window --- src/video/android/SDL_androidwindow.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 037b49079fdbc..cf18e67b43619 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -102,14 +102,17 @@ Android_SetWindowTitle(_THIS, SDL_Window * window) void Android_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) { - Android_JNI_SetWindowStyle(fullscreen); - - // Ensure our size matches reality after we've executed the window style change. - // - // It is possible that we've set width and height to the full-size display, but on - // Samsung DeX or Chromebooks or other windowed Android environemtns, our window may - // still not be the full display size. - // + /* If the window is being destroyed don't change visible state */ + if (!window->is_destroying) { + Android_JNI_SetWindowStyle(fullscreen); + } + + /* Ensure our size matches reality after we've executed the window style change. + * + * It is possible that we've set width and height to the full-size display, but on + * Samsung DeX or Chromebooks or other windowed Android environemtns, our window may + * still not be the full display size. + */ if (!SDL_IsDeXMode() && !SDL_IsChromebook()) { return; }