The previous commit vendored the pub.dev 1.0.4 release. The
GitHub repo (https://github.com/Swatimishra8/multi_window_native)
is ahead of pub.dev at 1.0.5 and contains improvements that
matter for the trainer-overlay use case:
- `windowDidBecomeKey` delegate to resume Flutter's render
pipeline on focus — fixes sub-windows freezing after the
main app regains focus.
- `applicationShouldHandleReopen` for dock-icon restore.
- Delayed (0.1s) cleanup of secondary windows in `closeWindow`
so Flutter's onWindowClose callbacks finish executing.
- `generateUniqueTitle`/`registerWindowTitle`/`unregisterWindowTitle`
bridge methods.
- Native Windows implementation in the package itself
(we still use our own runner/main.cpp wiring; the package's
Windows code is unused but harmless).
Re-applied the NSPanel substitution in `createNewWindow`:
.nonactivatingPanel + .utilityWindow style, level .screenSaver,
collectionBehavior including .fullScreenAuxiliary, initial size
220x140 / minSize 160x80 — so the sub-window sits above
fullscreened trainer apps from the moment it's shown.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Forked the upstream package
(https://github.com/Swatimishra8/multi_window_native) into
packages/multi_window_native and pinned pubspec to the path dep.
Key macOS change in the vendored plugin's createNewWindow:
- NSPanel instead of NSWindow with styleMask = [.titled, .closable,
.resizable, .nonactivatingPanel, .utilityWindow].
- isFloatingPanel = true, becomesKeyOnlyIfNeeded = true,
hidesOnDeactivate = false.
- level = .screenSaver (highest standard user-space level).
- collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary,
.stationary, .ignoresCycle].
- Initial size dropped from 1440x900 / minSize 800x900 to 220x140 /
minSize 160x80 (closer to what the trainer overlay needs).
With those properties set at construction time, the sub-window sits
above fullscreened trainer apps from the moment it's shown — no more
retry loop chasing the window after the fact.
MainFlutterWindow.swift's onEngineCreatedCallback no longer needs the
elevation retry; it just calls RegisterGeneratedPlugins on the new
engine and leaves the window-level work to the plugin.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>