Skip to main content

ensure_compositor

Function ensure_compositor 

Source
pub fn ensure_compositor(
    width: i32,
    height: i32,
    explicit_node: String,
    auto_gpu: String,
    fallback_node: String,
    cursor_size: i32,
) -> Result<Arc<Compositor>, Error>
Expand description

Get-or-create the singleton Wayland backend (idempotent: the first dimensions and render node win, and a later capture just resizes).

Called from capture start (which knows the operator’s real node) and from the import-time bootstrap when the deployment opts into pixelflux-as-compositor. The render node is chosen once, at creation, by precedence: an explicit render_node_path, then an auto_gpu pick, then the encoder node (so a caller that sets only one node still renders on that GPU); empty selects the software renderer.