From 67c7fa258b22afcb9c77f8bba68b8ba22f354318 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 30 Nov 2024 10:17:28 +0100 Subject: [PATCH] (Android) Fixed an issue where the application would go into a restart loop if the screen was internally rotated 90 or 270 degrees --- es-app/src/views/ViewController.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 86a419f19..7237886be 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -1568,7 +1568,11 @@ void ViewController::reloadAll() void ViewController::setWindowSizeChanged(const int width, const int height) { #if defined(__ANDROID__) - const std::pair windowSize {Utils::Platform::Android::getWindowSize()}; + std::pair windowSize {Utils::Platform::Android::getWindowSize()}; + const int screenRotation {Settings::getInstance()->getInt("ScreenRotate")}; + + if (screenRotation == 90 || screenRotation == 270) + windowSize = std::make_pair(windowSize.second, windowSize.first); if (windowSize.first == static_cast(mRenderer->getScreenWidth()) && windowSize.second == static_cast(mRenderer->getScreenHeight())) {