Skip to content

Adopt UIScene lifecycle and support iPhone Duo resizing - #729

Open
antoinealbaut23 wants to merge 2 commits into
moonlight-stream:masterfrom
antoinealbaut23:iphone-duo-support
Open

antoinealbaut23 wants to merge 2 commits into
moonlight-stream:masterfrom
antoinealbaut23:iphone-duo-support

Conversation

@antoinealbaut23

Copy link
Copy Markdown

Fixes #728.

On iPhone Duo, the current App Store build runs letterboxed on the inner display because it was built with an older SDK. Rebuilding with the iOS 27.1+ SDK fixes that, but exposes two problems this PR addresses.

1. Crash at launch with the iOS 27 SDK

When built with the current SDK, the app is terminated immediately at launch on iOS 27.1 (EXC_BREAKPOINT in _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption). UIKit now requires the scene-based lifecycle.

  • Adds a UIApplicationSceneManifest to Limelight-Info.plist and a SceneDelegate (iOS only, in AppDelegate.m so no project file changes are needed).
  • The scene delegate creates the window from the existing iPhone / iPad storyboards, which replace UIMainStoryboardFile / UIMainStoryboardFile~ipad.
  • Home screen quick actions (launch and while running) are forwarded to the existing AppDelegate handling, and the Core Data context is saved when the scene enters the background.
  • tvOS is unchanged.

2. Video doesn't follow window size changes

VideoDecoderRenderer sized the AVSampleBufferDisplayLayer once when the stream started. Folding or unfolding iPhone Duo during a stream changes the window size, and the video stayed at the old size.

  • The stream view (and the scroll view in absolute touch mode) now follow the root view's size.
  • StreamFrameViewController lays out the display layer again when its size changes, through a new -[StreamManager updateRendererLayout].
  • Touch mapping already used the live view bounds, so it needed no change.

Testing

  • Built with Xcode 27.2 (iOS 27.2 SDK), Release configuration.
  • Installed on an iPhone Duo running iOS 27.1 (24A94425): the app launches and no longer crashes. Without the scene changes, it crashed at launch every time.
  • Not tested yet: a full stream session while folding and unfolding, iPad, and tvOS. The iPhone Duo simulator was not available with the iOS 27.2 simulator runtime.

🤖 Generated with Claude Code

antoinealbaut23 and others added 2 commits October 23, 2026 22:24
Apps built with the iOS 27 SDK are terminated at launch by UIKit if they
don't use the scene-based lifecycle. Add a SceneDelegate that creates the
window from the existing iPhone/iPad storyboards, and forward home screen
quick actions and launch shortcuts to the existing AppDelegate handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The display layer was sized once when the stream started, so the video
didn't follow window size changes during a stream, such as folding or
unfolding iPhone Duo. Let the stream view follow its parent and lay out
the display layer again when the size changes.

Fixes moonlight-stream#728

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antoinealbaut23

Copy link
Copy Markdown
Author

Tested a full streaming session on iPhone Duo (iOS 27.1) with this branch: the app fills the entire inner display and streaming works perfectly, including folding and unfolding during the stream.

@pyro2927

Copy link
Copy Markdown

Built and running on my Duo as well!

@CharlesMcquade

Copy link
Copy Markdown

Another Duo owner here. Built master plus this PR with Xcode and it's been running great on my iPhone Duo. This plus the cellular fix already on master (#669) is everything I needed, so really hoping this lands and ships. Would love to retire my sideloaded copy!

enjoyerofslop added a commit to enjoyerofslop/moonlight-neo that referenced this pull request Oct 28, 2026
Say up front that this is an unofficial fork and where to get the
official app and its support, credit upstream PR moonlight-stream#729 for the scene
lifecycle work, list what's different for iPhone Duo, and update the
build steps for Xcode 27.1. Remove the App Store badge for the official
app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hada0127

hada0127 commented Nov 4, 2026

Copy link
Copy Markdown

I built current master plus this PR with Xcode 27.2 for a physical iPhone Duo running iOS 27.2. The app fills the inner display; pairing with Sunshine and starting a stream both work.

On the inner display, I found a black band above the host-list navigation bar. I proposed a small follow-up against this branch: antoinealbaut23#1

🤖 Generated with Claude Code

https://claude.ai/code/session_01YAvm9mGw2j77HiPzcZEQ33

@NemuiAlek

Copy link
Copy Markdown

Tested this on my iPhone Duo and it works great! Built current master + this PR with Xcode 27.2 and ran it on iOS 27.2. Pairing, streaming, and folding / unfolding mid-stream all just work, and it looks amazing on the inner display.

A few things I noticed while testing:

  • Master on its own crashes at launch when built with the iOS 27 SDK
    (_UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption), so this PR is pretty much required for any new build
  • I didn't see the black band above the host-list navigation bar that was mentioned above, at least on 27.2
  • I read through the diff: the AppDelegate lifecycle methods that stop getting called under scenes are all empty stubs, and the Core Data save from applicationWillTerminate is covered by sceneDidEnterBackground, so I don't see a regression there

Thanks for putting this together!

tkanjanarux added a commit to tkanjanarux/moonlight-ios that referenced this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iPhone Duo: app runs letterboxed on inner display (needs iOS 27.1 SDK)

5 participants