mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-27 01:13:09 +00:00
Adds weft-compositor/src/appd_ipc.rs: WeftAppdIpc state, setup() registers a calloop UnixListener source. Accepted connections are registered as edge-triggered read sources. Incoming AppdToCompositor frames are decoded and dispatched; AppSurfaceCreated records pid->session mapping in pending_pids for later wl_surface association. Wires into both the DRM and Winit backends. Socket path: /weft/compositor.sock or WEFT_COMPOSITOR_SOCKET override.
28 lines
751 B
Rust
28 lines
751 B
Rust
use tracing_subscriber::EnvFilter;
|
|
|
|
mod appd_ipc;
|
|
mod backend;
|
|
mod input;
|
|
mod protocols;
|
|
mod state;
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
tracing_subscriber::fmt()
|
|
.with_env_filter(
|
|
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
|
|
)
|
|
.init();
|
|
|
|
let args: Vec<String> = std::env::args().collect();
|
|
let use_winit = args.iter().any(|a| a == "--winit")
|
|
|| std::env::var("DISPLAY").is_ok()
|
|
|| std::env::var("WAYLAND_DISPLAY").is_ok();
|
|
|
|
if use_winit {
|
|
tracing::info!("starting compositor with winit backend");
|
|
backend::winit::run()
|
|
} else {
|
|
tracing::info!("starting compositor with DRM/KMS backend");
|
|
backend::drm::run()
|
|
}
|
|
}
|