mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
Task 10 -- App WebView lifecycle. appd_ws module (servo-embed gated): Background thread connects to the appd WebSocket on startup. Sends QUERY_RUNNING to receive initial running sessions. Translates LAUNCH_ACK -> AppdCmd::Launch and APP_STATE stopped -> AppdCmd::Stop, then wakes the winit event loop via the shared EventLoopWaker. embedder changes: App struct gains app_rx (mpsc receiver), app_webviews (HashMap<session_id, WebView>), active_session, and a stored rendering_context used when creating app WebViews later. create_app_webview(): resolves weft-app://<app_id>/index.html to a file URL, creates a dedicated UserContentManager with the weftIpc bridge injected (includes window.weftSessionId), builds and registers a new WebView. about_to_wait() drains app_rx: creates WebViews for Launch commands, removes and clears active_session for Stop commands. active_webview() returns the active-session WebView when one exists, falling back to the system-ui WebView. Rendering, keyboard, and mouse events all route through active_webview(). Resize propagates to both the system WebView and all app WebViews. run() creates the mpsc channel and spawns the appd listener before entering the winit event loop. |
||
|---|---|---|
| .. | ||
| weft-appd | ||
| weft-build-meta | ||
| weft-compositor | ||
| weft-file-portal | ||
| weft-ipc-types | ||
| weft-mount-helper | ||
| weft-pack | ||
| weft-runtime | ||
| weft-servo-shell | ||