| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 17 天前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 |
Multi-Window Example
This example demonstrates MoUI's host-managed scene model and the app-facing
HostWindowActions lifecycle helpers.
What it shows
- Open Inspector enqueues
HostWindowActions::openfor scene idinspector. The host resolves the scene to a freshAppRuntime. - Focus Inspector / Close Inspector enqueue
HostWindowActions::focus/closeby window id. When the host has not reported an id back into the model, the demo uses a provisional id so the request shape is still visible in tests and queue drains. - Increment shared updates app-owned shared state. Scenes do not share a runtime; reopen the inspector to snapshot a new payload string.
- On the retained macOS entrypoint, Open creates a second native window.
- On Web, Open creates a second independent canvas in the current page (not a browser popup or tab).
- Mobile embedded-session hosts do not support this multi-window model.
Run
moon run examples/multi_window/macos_skia --target native
moon build examples/multi_window/web_wasm --target wasm-gc
moon test examples/multi_window/app --target native
Entrypoint wiring
Each platform entrypoint:
- Creates one
HostWindowRequestQueue - Builds
HostWindowActionson that queue - Installs a
HostWindowSceneResolverthat mapsmain/inspectorto a newAppRuntime - Passes the queue through
AppBuilder::window_requests
See docs/platform-host-contract.md for the host registry and request-queue
contracts.