From 1137fe7436e75d170f7c33f45a3866eaedcd6c66 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Mon, 23 Sep 2019 23:59:25 +0300 Subject: [PATCH 1/2] [ios] add iPhones 11 to the list of known devices --- xbmc/platform/darwin/DarwinUtils.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xbmc/platform/darwin/DarwinUtils.mm b/xbmc/platform/darwin/DarwinUtils.mm index 658a6d4fa4b78..e14edaf839d19 100644 --- a/xbmc/platform/darwin/DarwinUtils.mm +++ b/xbmc/platform/darwin/DarwinUtils.mm @@ -81,6 +81,7 @@ iPhone7, iPhone8, iPhoneXR, + iPhone11, iPadAir2Wifi, iPadAir2Cellular, iPadPro9_7InchWifi, @@ -108,6 +109,8 @@ iPhoneX, iPhoneXS, iPhoneXSMax, + iPhone11Pro, + iPhone11ProMax, }; // platform strings are based on http://theiphonewiki.com/wiki/Models @@ -174,6 +177,9 @@ enum iosPlatform getIosPlatform() else if (devStr == "iPhone11,2") eDev = iPhoneXS; else if (devStr == "iPhone11,6") eDev = iPhoneXSMax; else if (devStr == "iPhone11,8") eDev = iPhoneXR; + else if (devStr == "iPhone12,1") eDev = iPhone11; + else if (devStr == "iPhone12,3") eDev = iPhone11Pro; + else if (devStr == "iPhone12,5") eDev = iPhone11ProMax; else if (devStr == "iPod1,1") eDev = iPodTouch1G; else if (devStr == "iPod2,1") eDev = iPodTouch2G; else if (devStr == "iPod3,1") eDev = iPodTouch3G; From 6b09a81a97739022af0233162211d4ffedfbddef Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 25 Sep 2019 22:24:05 +0300 Subject: [PATCH 2/2] [ios] don't rely on main screen having only one screen mode - it's not true for iPhones 11 partially reverts a85e511 --- xbmc/windowing/osx/WinSystemIOS.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm index f077304de847c..131cb38a86290 100644 --- a/xbmc/windowing/osx/WinSystemIOS.mm +++ b/xbmc/windowing/osx/WinSystemIOS.mm @@ -189,21 +189,21 @@ - (void) runDisplayLink; UIScreenMode *getModeForResolution(int width, int height, unsigned int screenIdx) { - UIScreen *aScreen = [[UIScreen screens]objectAtIndex:screenIdx]; - for ( UIScreenMode *mode in [aScreen availableModes] ) + auto screen = UIScreen.screens[screenIdx]; + for (UIScreenMode* mode in screen.availableModes) { //for main screen also find modes where width and height are //exchanged (because of the 90°degree rotated buildinscreens) - if((mode.size.width == width && mode.size.height == height) || - (screenIdx == 0 && mode.size.width == height && mode.size.height == width) - || screenIdx == 0) // for screenIdx == 0 - which is the mainscreen - we only have one resolution - match it every time + auto modeSize = mode.size; + if ((modeSize.width == width && modeSize.height == height) || + (screenIdx == 0 && modeSize.width == height && modeSize.height == width)) { - CLog::Log(LOGDEBUG,"Found matching mode"); + CLog::Log(LOGDEBUG, "Found matching mode: {} x {}", modeSize.width, modeSize.height); return mode; } } CLog::Log(LOGERROR,"No matching mode found!"); - return NULL; + return nil; } bool CWinSystemIOS::SwitchToVideoMode(int width, int height, double refreshrate)