Skip to content

feat(mobile): add multi window support - #1154

Merged
FabianLars merged 22 commits into
devfrom
feat/mobile-multi-window
Mar 22, 2026
Merged

feat(mobile): add multi window support#1154
FabianLars merged 22 commits into
devfrom
feat/mobile-multi-window

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

Leverages scenes on iOS and Activity embedding on Android.

iOS

  • Added Event::SceneRequested (on iPad the user can request a new window to be open - e.g. by long pressing the app icon and selecting "New window")
  • Request new scene to be created on Window::new (if needed, main scene is detected automatically) and assign the window instance later when it gets connected

Android

  • Create new activity on Window::new (if needed, main activity is detected automatically)
  • Added builder methods to determine the activity to be created
  • System determines what to do with the activity (new stack, next to another one.. based on the embedding rules)

@lucasfernog
lucasfernog requested a review from a team as a code owner November 17, 2025 11:39
@github-actions

github-actions Bot commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Package Changes Through 3d0e116

There are 1 changes which include tao with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.34.6 0.35.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@lucasfernog

Copy link
Copy Markdown
Member Author

needs tauri-apps/wry#1633

Comment thread src/platform_impl/ios/window.rs Outdated
// when we support multiple scenes, request the activation of this window's scene
if application.supportsMultipleScenes() {
// alternative function is iOS 17+
#[allow(deprecated)]

@velocitysystems velocitysystems Nov 25, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this API is deprecated and will be removed in the future we should use activateSceneSession(for:errorHandler:).

Can we use conditional logic based on availability? e.g.

if #available(iOS 17, *) {
   // Use supported API
} else {
   #[allow(deprecated)]
   // Fallback to deprecated API
}

Also - no error handler is set which means scene activation failures will be invisible.
Should we add logging and an optional fallback path?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// alternative function is iOS 17+
#[allow(deprecated)]
application.requestSceneSessionActivation_userActivity_options_errorHandler(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using deprecated API, no error handler is set. See this comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// instead of returning an Option here, we default to an empty string
// scene lifecycle will be enforced anyway soon (iOS 27)
pub fn scene_identifier(&self) -> String {

@velocitysystems velocitysystems Nov 25, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple windows without scenes get the same "" identifier.
Should we instead return Option<String> and handle downstream?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're not using scenes, doesn't make much sense to use this getter
returning an Option here is inconvenient - scenes will be enforced next year, and Apple is already giving warnings

@@ -143,155 +185,125 @@ impl<T: 'static> EventLoop<T> {
}
Event::Stop => self.running = false,
Event::Start => self.running = true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handlers for Event::Start and EventSource::InputQueue have been commented out. Is additional work required?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those variants simply weren't being used

@socket-security

socket-security Bot commented Dec 2, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedlibc@​0.2.180 ⏵ 0.2.1787910093100100
Addedobjc2-ui-kit@​0.3.010010093100100
Updatedbitflags@​2.8.0 ⏵ 2.7.010010093100100
Updateddispatch2@​0.3.0 ⏵ 0.3.110010093100100

View full report

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.

3 participants