From b642984755dcd6a3bccbbb2f42746e282ae9f6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 23:04:15 +0200 Subject: [PATCH] Outputs: Decide on the TV mode by the running backend iOS and Android checked the backend setting, which a change sets right away while the restart prompt is still up. A TV connected then got an output OpenGL can't draw to, and showed black instead of mirroring. Co-Authored-By: Claude Opus 5.5 (1M context) --- android/jni/app-android.cpp | 5 +++-- ios/ExternalDisplaySceneDelegate.mm | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 93c708ded5..5b317acfe9 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -593,8 +593,9 @@ static std::string QueryConfig(std::string_view query) { } else if (query == "audioMixWithOthers") { return g_Config.bAudioMixWithOthers ? "1" : "0"; } else if (query == "externalDisplayOutput") { - // Whether the game goes to a second display, see ExternalDisplayPresentation.java. - return g_Config.iGPUBackend == (int)GPUBackend::VULKAN && g_Config.iExternalDisplay == (int)ExternalDisplayMode::SHOW_GAME ? "1" : "0"; + // Whether the game goes to a second display, see ExternalDisplayPresentation.java. The running backend: the + // setting is already the new one while the restart prompt for a change is up. + return GetGPUBackend() == GPUBackend::VULKAN && g_Config.iExternalDisplay == (int)ExternalDisplayMode::SHOW_GAME ? "1" : "0"; } else { return ""; } diff --git a/ios/ExternalDisplaySceneDelegate.mm b/ios/ExternalDisplaySceneDelegate.mm index 6dcdea29b5..39711f4550 100644 --- a/ios/ExternalDisplaySceneDelegate.mm +++ b/ios/ExternalDisplaySceneDelegate.mm @@ -24,6 +24,7 @@ #include "Common/System/NativeApp.h" #include "Core/Config.h" #include "Core/ConfigValues.h" +#include "Core/System.h" static NSString *const PPSSPPExternalDisplayUpdateNotification = @"PPSSPPExternalDisplayUpdate"; @@ -116,7 +117,8 @@ static bool g_launched = false; return; } // Without a window, iOS mirrors the phone. - if (g_Config.iGPUBackend != (int)GPUBackend::METAL && g_Config.iGPUBackend != (int)GPUBackend::VULKAN) { + // The running backend: the setting is already the new one while the restart prompt for a change is up. + if (GetGPUBackend() != GPUBackend::METAL && GetGPUBackend() != GPUBackend::VULKAN) { INFO_LOG(Log::G3D, "External display: mirroring, as the backend can't present to it"); return; }