mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-27 09:23: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.
26 lines
669 B
TOML
26 lines
669 B
TOML
[package]
|
|
name = "weft-servo-shell"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[[bin]]
|
|
name = "weft-servo-shell"
|
|
path = "src/main.rs"
|
|
|
|
[features]
|
|
# Enable actual Servo rendering. Requires manually adding the deps listed in
|
|
# SERVO_PIN.md to this file before building; they are not included here to
|
|
# avoid pulling the Servo monorepo (~1 GB) into every `cargo check` cycle.
|
|
servo-embed = []
|
|
|
|
[dependencies]
|
|
anyhow = "1.0"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
wayland-client = "0.31"
|
|
wayland-backend = "0.3"
|
|
wayland-scanner = "0.31"
|
|
bitflags = "2"
|
|
serde_json = "1"
|
|
tungstenite = "0.24"
|