Repository navigation
Conversation
Apps built with the iOS 27 SDK are terminated at launch unless they adopt the scene-based life cycle. Add a scene manifest (with an iPad variant for the iPad storyboard) and a scene delegate that handles home screen quick actions, and let the alert and loading frame presenters find a window before one has become key.
iPhone Duo moves the scene between displays of different sizes when it is folded or unfolded mid-stream, and iPad windows can be resized. Keep the stream view, video layer, labels and on-screen controls sized to the view, use the large screen control layout on displays that are regular-sized in both dimensions, and keep controls off active fold (division) regions. Also opt the stream out of the vertical bar, release on-screen controls when touches are cancelled, clamp the frame rate to the display the stream starts on, and keep the host list, app tiles, loading spinner and settings padding right across display changes. Fill the area above the navigation bar with the bar color instead of leaving a black band at the top of the screen.
A display link from the window scene is retargeted when the scene moves to another display, like when iPhone Duo is folded or unfolded mid-stream, so frame pacing follows the display the stream is on. The window scene can only be read on the main thread, so create the display link there, and invalidate it there too so no callback can run after stop returns. This can't deadlock because LiStopConnection() is always called on a background queue (see Connection.m), so the main thread never waits for the renderer to stop.
Save the full screen and safe area options as special values that are resolved when a stream starts, so they match whichever display the stream is on (like the inner and outer displays of iPhone Duo) instead of the one the settings were opened on. Compute them from the native scale, round them to the even dimensions video encoders require (the inner display of iPhone Duo used to request 2853x2007), and leave room for the larger safe area inset on both sides since the video is centered. Also recognize sizes saved by older versions as these options, keep custom resolutions custom even when they match the current display, and round custom resolutions to even dimensions.
iPhone only supports mice through AssistiveTouch. It reports the mouse through GCMouse but doesn't always deliver its buttons there, and the system pointer was drawn on top of the host's cursor. On iPhone, fall back to the UIKit pointer button events until GCMouse delivers a button event and then use only GCMouse's, and keep the system pointer hidden over the stream while GCMouse moves the cursor.
Swiping from the left edge ended the stream as soon as the swipe was recognized, so tapping or dragging near that edge, like on a dock at the side of the host's desktop, could disconnect by accident. Only end the stream when a swipe from the edge is completed and covers at least 100 points, and only accept finger touches so dragging a mouse along the edge doesn't count.
Let users fill displays whose aspect ratio differs from the host's, like the 1.42:1 inner display of iPhone Duo streaming a 16:9 desktop. Fit keeps the current behavior, Fill crops the edges of the video that don't fit and Stretch distorts the video to fill the screen. StreamView now computes the video region for every mode, and the video layer, touch and mouse mapping and pointer region all use it. The setting is stored in a new Core Data model version (Moonlight v1.11), which is migrated automatically.
|
Tested on my Duo and wanted to confirm it works and looks very well. Nice job! Even closing and opening the hinge works seamlessly which is quite impressive. I'm not sure if this was a thing previously on IOS at all but is menu navigation supposed to work with a controller? Not a huge deal either way obviously the screen is there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iPhone Duo runs the current App Store build letterboxed on its inner display (#728), and master built with the iOS 27 SDK is terminated at launch because it doesn't adopt the scene life cycle. This PR fixes both and makes streaming fit iPhone Duo's displays. The commits are separate steps that each build on their own, so I'm happy to split them into separate PRs or drop any of them.
LiStopConnection()is always called on a background queue (Connection.m).Notes:
UIRequiresFullScreenand the supported orientations are unchanged. The only project file changes add the scene delegate and the model version.Testing with Xcode 27.1:
iPhone Duo owners only have the letterboxed build for now, so I'd be very grateful if this could make it into the next App Store release. I'll follow up quickly on any review feedback.