Skip to content

Implement satellite windows on Win32 - #192939

Merged
auto-submit[bot] merged 12 commits into
flutter:masterfrom
canonical:satellite_win32_v2
Oct 9, 2026
Merged

auto-submit[bot] merged 12 commits into
flutter:masterfrom
canonical:satellite_win32_v2

Conversation

@mattkae

@mattkae mattkae commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

This pull request implements satellite windows for Win32 📡

What's new?

  • Moved AlignOriginWithFrame to HostWindow
  • Moved GetInitialWindowSize to HostWindow
  • Add WindowArchetype::kSatellite.
  • Add HostWindowSatellite, deriving from HostWindowSized. Fixed-size satellites resolve their placement synchronously during construction so the window is created at its target position; sized-to-content satellites position from ApplyContentSize after the first frame. Both paths align the window frame, rather than the window rectangle, with the positioner's origin.
  • Add HostWindow::CreateSatelliteWindow
  • Propagate parent movement on WM_WINDOWPOSCHANGED to satellites in order to move them with their parent
  • Reject reparenting that would make a satellite its own ancestor
  • Implement SatelliteWindowControllerWin32 and its FFI bindings
  • Add satellite windows to the example application

How to test?

Run the multiple windows example application and play with satellites there 🎉

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant in-code documentation (doc comments with ///).
  • If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. platform-windows Building on or for Windows specifically a: desktop Running on desktop team-windows Owned by the Windows platform team labels Sep 17, 2026
@google-cla

google-cla Bot commented Sep 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added the d: examples Sample code and demos label Sep 17, 2026
Comment thread examples/multiple_windows/README.md Resolved
@github-actions github-actions Bot added the a: tests "flutter test", flutter_test, or one of our tests label Sep 18, 2026
@mattkae
mattkae force-pushed the satellite_win32_v2 branch 3 times, most recently from e649291 to 6f770f2 Compare September 18, 2026 17:16
@mattkae

mattkae commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

This will need to be rebased on #192990

@github-actions github-actions Bot removed the a: tests "flutter test", flutter_test, or one of our tests label Sep 21, 2026
Satellite windows are auxiliary top-level windows anchored to a parent:
they are decorated and activatable like a regular window, are positioned
once at creation by a Dart-supplied positioner, then retain their offset
from the parent as it moves. They cannot be minimized on their own, can
be reparented at runtime without changing screen position, and are
destroyed along with their parent.

The public framework API (SatelliteWindowController, SatelliteWindow,
WindowingOwner.createSatelliteWindowController) already landed; every
backend threw UnimplementedError. This fills in the Win32 backend, making
it the first platform with working satellites.

Engine:
  * Add WindowArchetype::kSatellite.
  * Add HostWindowSatellite, deriving from HostWindowSized. Fixed-size
    satellites resolve their placement synchronously during construction
    so the window is created at its target position; sized-to-content
    satellites position from ApplyContentSize after the first frame.
    Both paths align the window frame, rather than the window rectangle,
    with the positioner's origin.
  * Add HostWindow::CreateSatelliteWindow.
  * Track satellites in WindowManager and propagate parent movement on
    WM_WINDOWPOSCHANGED, resolving handles to live satellites on each
    iteration since nested message handling may destroy them.
  * Reject reparenting that would make a satellite its own ancestor,
    which would otherwise recurse until the stack is exhausted.

Framework:
  * Implement SatelliteWindowControllerWin32 and its FFI bindings. The
    positioner callback scales by the parent's device pixel ratio, since
    the anchor rect is in the parent's coordinate space and the
    satellite's own view does not exist yet when the callback first runs.

Example:
  * Add satellite window support to the multiple_windows example app,
    including creation, editing and positioning of satellites.
@mattkae
mattkae marked this pull request as ready for review September 21, 2026 15:19
@mattkae
mattkae requested a review from a team as a code owner September 21, 2026 15:19

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request implements satellite windows on the Windows platform, introducing the HostWindowSatellite class in C++ and the corresponding SatelliteWindowControllerWin32 in Dart, along with associated unit tests and updates to the multiple-windows example. Feedback on the changes suggests using std::optional<POINT> to safely track the parent window's position and avoid incorrect movement deltas if GetWindowRect fails. Additionally, it is recommended to trigger window metrics events on any dimension inequality rather than only when the size decreases, and to call SetWindowPos with SWP_FRAMECHANGED after modifying the window owner with SetWindowLongPtr to force immediate OS updates.

@mattkae mattkae added the CICD Run CI/CD label Sep 22, 2026
# Conflicts:
#	engine/src/flutter/shell/platform/windows/window_manager.cc
@auto-submit

auto-submit Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/192939, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

  • The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@mattkae mattkae added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2026
@auto-submit

auto-submit Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/192939, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@loic-sharma

Copy link
Copy Markdown
Member

Rerunning google tests...

@mattkae mattkae added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 9, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 9, 2026
Merged via the queue into flutter:master with commit 97eacad Oct 9, 2026
29 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 9, 2026
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
This pull request implements satellite windows for Win32 📡

## What's new?

- Moved `AlignOriginWithFrame` to `HostWindow`
- Moved `GetInitialWindowSize` to `HostWindow`
- Add WindowArchetype::kSatellite.
- Add HostWindowSatellite, deriving from HostWindowSized. Fixed-size
satellites resolve their placement synchronously during construction so
the window is created at its target position; sized-to-content
satellites position from ApplyContentSize after the first frame. Both
paths align the window frame, rather than the window rectangle, with the
positioner's origin.
- Add HostWindow::CreateSatelliteWindow
- Propagate parent movement on `WM_WINDOWPOSCHANGED` to satellites in
order to move them with their parent
- Reject reparenting that would make a satellite its own ancestor
- Implement SatelliteWindowControllerWin32 and its FFI bindings
- Add satellite windows to the example application

## How to test?
Run the multiple windows example application and play with satellites
there 🎉

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD d: examples Sample code and demos engine flutter/engine related. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. platform-windows Building on or for Windows specifically team-windows Owned by the Windows platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants