Skip to content

Conversation

@kaascevich
Copy link
Contributor

@kaascevich kaascevich commented Dec 28, 2025

This PR:

  • Adds a Window scene and its associated WindowNode
    • Only one instance of Window can be open at a time
    • Window requires a title and an ID
  • Implement multi-window support for WindowGroup
  • Implements the dismissWindow environment action, which closes the enclosing window
  • Implements the openWindow environment action, which opens a Window or WindowGroup given its ID
  • Factors out the window setup and view graph updating code into a new (internal) WindowReference type
  • Adds the defaultLaunchBehavior(_:) scene modifier, which controls whether scenes appear on app launch
    • The automatic option matches the current behavior, namely that WindowGroups are opened on app launch but Windows aren't
  • Adds the supportsMultipleWindows environment value, which can be used to check whether the current platform supports multi-window
    • As far as the implementation is concerned, they all do, but practically speaking mobile backends don't typically support it

@kaascevich kaascevich marked this pull request as draft January 2, 2026 00:04
#Conflicts:
#	Examples/Sources/WindowingExample/WindowingApp.swift
#	Sources/SwiftCrossUI/Environment/Actions/DismissAction.swift
#	Sources/SwiftCrossUI/Environment/EnvironmentValues.swift
@kaascevich kaascevich marked this pull request as ready for review January 2, 2026 04:01
@kaascevich kaascevich changed the title Add Window scene and openWindow environment action Add Window scene and openWindow environment action, and add multi-window support to WindowGroup Jan 2, 2026
@stackotter stackotter changed the title Add Window scene and openWindow environment action, and add multi-window support to WindowGroup Add Window scene, openWindow action, dismissWindow action, fix window close handling, and add multi-window support to WindowGroup Jan 2, 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.

1 participant