From e1ee540d27d14bb187f30b4720d752cb1f5bbe10 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 12 Aug 2022 19:21:54 -0500 Subject: [PATCH] [iPad] Fixes automatically pausing + resuming emulation with Stage Manager on iOS 16 beta 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use DeltaCore’s new UIWindow subclass GameWindow in SceneDelegate to fix issues that were introduced with iOS 16 beta 5. Also removes touchControllerSkin.layoutGuide = self.view.safeAreaLayoutGuide assignment which no longer compiles due to TouchControllerSkin refactoring. --- Cores/DeltaCore | 2 +- Delta/Emulation/GameViewController.swift | 1 - Delta/SceneDelegate.swift | 17 ++++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 90aa403..6a7a856 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 90aa403e229ea1993fad455b41cc8c9ceb9da46a +Subproject commit 6a7a856a14739a9700f4121ca95d65d49744faf0 diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index e5d65bd..2942a75 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -663,7 +663,6 @@ private extension GameViewController else if let controllerSkin = DeltaCore.ControllerSkin.standardControllerSkin(for: game.type), controllerSkin.hasTouchScreen(for: traits) { var touchControllerSkin = TouchControllerSkin(controllerSkin: controllerSkin) - touchControllerSkin.layoutGuide = self.view.safeAreaLayoutGuide if self.view.bounds.width > self.view.bounds.height { diff --git a/Delta/SceneDelegate.swift b/Delta/SceneDelegate.swift index 6b0ba89..9f5ddbd 100644 --- a/Delta/SceneDelegate.swift +++ b/Delta/SceneDelegate.swift @@ -14,7 +14,20 @@ import Harmony @objc(SceneDelegate) @available(iOS 13, *) class SceneDelegate: UIResponder, UIWindowSceneDelegate { - var window: UIWindow? + var window: UIWindow? { + get { + if _window == nil + { + _window = GameWindow() + } + + return _window + } + set { + _window = newValue as? GameWindow + } + } + private var _window: GameWindow? private let deepLinkController = DeepLinkController() @@ -35,6 +48,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { self.handle(.shortcut(shortcutItem)) } + + self.window?.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene)