From 0e7c85d89e6635005dc35f52a3d095e904abdea9 Mon Sep 17 00:00:00 2001 From: Xie Yi Date: Wed, 19 Jun 2019 17:47:14 +0800 Subject: [PATCH] Disable external display by default Configuration is in system settings --- CMakeLists.txt | 2 ++ ios/DisplayManager.mm | 4 ++++ ios/Settings.bundle/Root.plist | 21 +++++++++++++++++++++ ios/Settings.bundle/en.lproj/Root.strings | Bin 0 -> 480 bytes 4 files changed, 27 insertions(+) create mode 100644 ios/Settings.bundle/Root.plist create mode 100644 ios/Settings.bundle/en.lproj/Root.strings diff --git a/CMakeLists.txt b/CMakeLists.txt index 3735f82025..547d322307 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1988,6 +1988,7 @@ if(TargetBin) endif() if(IOS) + list(APPEND NativeAssets ios/Settings.bundle) add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Launch Screen.storyboard") else() add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource}) @@ -2044,6 +2045,7 @@ if(IOS) set_target_properties(${TargetBin} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-Info.plist" RESOURCE "ios/Launch Screen.storyboard" + RESOURCE "ios/Settings.bundle" XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET} XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "iPhone/iPad" XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES diff --git a/ios/DisplayManager.mm b/ios/DisplayManager.mm index 1bd04aa1a1..495353a6df 100644 --- a/ios/DisplayManager.mm +++ b/ios/DisplayManager.mm @@ -49,6 +49,10 @@ } - (void)setupDisplayListener { + // Disable external display by default + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_external_display"] == NO) { + return; + } if ([self listenerActive]) { NSLog(@"setupDisplayListener already called"); return; diff --git a/ios/Settings.bundle/Root.plist b/ios/Settings.bundle/Root.plist new file mode 100644 index 0000000000..627d9c50de --- /dev/null +++ b/ios/Settings.bundle/Root.plist @@ -0,0 +1,21 @@ + + + + + StringsTable + Root + PreferenceSpecifiers + + + Type + PSToggleSwitchSpecifier + Title + enable_external_display + Key + enable_external_display + DefaultValue + + + + + diff --git a/ios/Settings.bundle/en.lproj/Root.strings b/ios/Settings.bundle/en.lproj/Root.strings new file mode 100644 index 0000000000000000000000000000000000000000..cc9f6b61f9b3065f4b63eb8a342290f9c0a47a41 GIT binary patch literal 480 zcmaiwL2kk@6hvpuDXc6JDhH@oAe9?*k3!;TN71-**WNf>WFKA z(bH*I-aFWF)K+*$?N#at-fOPx`F9%6vscoI88u2LvO^$K!nb5^^$Fq}6<7zuGl$Gg z{A(Cay@P$Zp}#&ydd}%LNO_O&oHI~2{QtX`Z!*-r&0 Yfp)PX;f?n=!QRtazKXlMnP5=M^ literal 0 HcmV?d00001