Merge branch 'master' into 12.0-development

This commit is contained in:
Alex Szpakowski
2020-12-26 22:48:08 -04:00
9 changed files with 149 additions and 55 deletions
+15 -4
View File
@@ -443,15 +443,23 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
height = mode.h;
}
// On Android we always must have fullscreen type FULLSCREEN_TYPE_DESKTOP
// On Android, disable fullscreen first on window creation so it's
// possible to change the orientation by specifying portait width and
// height, otherwise SDL will pick the current orientation dimensions when
// fullscreen flag is set. Don't worry, we'll set it back later when user
// also requested fullscreen after the window is created.
// See https://github.com/love2d/love-android/issues/196
#ifdef LOVE_ANDROID
bool fullscreen = f.fullscreen;
f.fullscreen = false;
f.fstype = FULLSCREEN_DESKTOP;
#endif
int x = f.x;
int y = f.y;
if (f.useposition && !f.fullscreen)
if (f.useposition)
{
// The position needs to be in the global coordinate space.
SDL_Rect displaybounds = {};
@@ -544,7 +552,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
// Enforce minimum window dimensions.
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
if (this->settings.display != f.display || ((f.useposition || f.centered) && !f.fullscreen))
if (this->settings.display != f.display || f.useposition || f.centered)
SDL_SetWindowPosition(window, x, y);
SDL_RaiseWindow(window);
@@ -569,8 +577,11 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
}
}
// Set fullscreen when user requested it before.
// See above for explanation.
#ifdef LOVE_ANDROID
love::android::setImmersive(f.fullscreen);
setFullscreen(fullscreen);
love::android::setImmersive(fullscreen);
#endif
return true;