Add support for multi-window popups on Windows #56092
Open
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.
Design doc: https://docs.google.com/document/d/1eQG-IS7r4_S9_h50MY_hSGwUVtgSTRSLzu7MLzPNd2Y/edit?tab=t.0
This PR is a part of a group of PRs. Going from first to last, these must be merged in the following order:
See also the corresponding framework PRs for multi-win support, starting from: flutter/flutter#157515
What's New
This pull request adds support for multi-window popups in the Windows embedder and introduces logic for positioning child windows relative to a parent view or parent window.
A new method is available in the
flutter/windowing
channel:createPopup(Map)
Map
must contain the following key-value pairs:String
)"parent"
int
)"size"
List<int>
)"anchorRect"
null
, the child window will be positioned relative to the window frame of the parent (List<int>
)"positionerParentAnchor"
WindowPositionerAnchor
)"positionerChildAnchor"
WindowPositionerAnchor
)"positionerOffset"
List<int>
)"positionerConstraintAdjustment"
WindowPositioner::ConstraintAdjustment
, defining the adjustments to apply if the child window doesn't fit in the available space. The order of precedence is: 1) Flip, 2) Slide, 3) Resize (int
)On success, a
Map
is returned with the following key-value pairs:String
)"viewId"
int
)"archetype"
WindowArchetype::popup
"size"
List<int>
)"parentViewId"
int
)If the method fails, a
PlatformException
is thrown.Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.