{"record":{"id":"7e467ade7cdcb7f2","repo":"tonhowtf/omniget","slug":"sessao-wayland-sem-xwayland-o-x11grab-nao-enxerga-a-tela-use","errorCode":null,"errorMessage":"sessao Wayland sem XWayland: o x11grab nao enxerga a tela. Use a captura do OmniDisc (PipeWire) ou entre numa sessao X11.","messagePattern":"sessao Wayland sem XWayland: o x11grab nao enxerga a tela\\. Use a captura do OmniDisc \\(PipeWire\\) ou entre numa sessao X11\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/screen_record.rs","lineNumber":340,"sourceCode":"            \"-segment_format_options\".into(),\n            \"movflags=+faststart\".into(),\n        ]);\n        a.push(target.join(\"seg-%03d.mp4\").to_string_lossy().to_string());\n    } else {\n        a.push(target.to_string_lossy().to_string());\n    }\n    a\n}\n\npub async fn start(opts: RecordOptions) -> anyhow::Result<RecordState> {\n    if SESSION.lock().unwrap_or_else(|e| e.into_inner()).is_some() {\n        return Err(anyhow!(\"ja esta gravando\"));\n    }\n    if cfg!(target_os = \"linux\")\n        && std::env::var(\"WAYLAND_DISPLAY\").is_ok()\n        && std::env::var(\"DISPLAY\").is_err()\n    {\n        return Err(anyhow!(\"sessao Wayland sem XWayland: o x11grab nao enxerga a tela. Use a captura do OmniDisc (PipeWire) ou entre numa sessao X11.\"));\n    }\n    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;\n    let dir = if opts.output_dir.trim().is_empty() {\n        videos_dir()\n    } else {\n        PathBuf::from(opts.output_dir.trim())\n    };\n    std::fs::create_dir_all(&dir)?;\n    let ring = opts.replay_seconds > 0;\n    let (target, ring_dir, output) = if ring {\n        let r = super::temp_dir().join(format!(\"replay-{}\", uuid::Uuid::new_v4()));\n        std::fs::create_dir_all(&r)?;\n        (r.clone(), Some(r), None)\n    } else {\n        let out = dir.join(format!(\"Gravacao {}.mp4\", stamp()));\n        (out.clone(), None, Some(out))\n    };\n    let args = build_args(&opts, &target, ring);","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/screen_record.rs#L322-L358","documentation":"On Linux, screen_record::start() uses ffmpeg's x11grab, which cannot see a pure Wayland session. If WAYLAND_DISPLAY is set and DISPLAY is not (no XWayland), start() fails immediately with this guidance to use PipeWire capture or an X11 session.","triggerScenarios":"Calling start() on Linux while running a Wayland session (e.g. GNOME Wayland, KDE Wayland) without XWayland installed or without DISPLAY set.","commonSituations":"Minimal Wayland setups without xwayland package; running inside a sandbox/container that hides DISPLAY; newer distro defaults shipping Wayland-only sessions.","solutions":["Install/enable XWayland so DISPLAY is set (e.g. install xorg-x11-server-Xwayland)","Log into an X11 session instead of Wayland","Use the OmniDisc (PipeWire) capture path for Wayland instead of this x11grab tool","Check env: echo $DISPLAY must be non-empty for x11grab to work"],"exampleFix":"// before (Wayland-only session)\nstart(opts).await?; // errors\n// after\nif std::env::var(\"WAYLAND_DISPLAY\").is_ok() && std::env::var(\"DISPLAY\").is_err() {\n    // route to PipeWire-based capture instead\n    start_pipewire(opts).await?;\n} else {\n    start(opts).await?;\n}","handlingStrategy":"validation","validationCode":"if cfg!(target_os = \"linux\")\n    && std::env::var(\"WAYLAND_DISPLAY\").is_ok()\n    && std::env::var(\"DISPLAY\").is_err()\n{\n    eprintln!(\"Wayland without XWayland: use PipeWire capture or an X11 session\");\n}","typeGuard":null,"tryCatchPattern":"match screen_record::start(opts).await {\n    Err(e) if e.to_string().contains(\"Wayland sem XWayland\") => {\n        // fall back to PipeWire-based capture\n        start_pipewire_capture(opts).await\n    }\n    other => other,\n}","preventionTips":["Detect the session type (WAYLAND_DISPLAY vs DISPLAY) before recording","Install XWayland (xorg-x11-server-Xwayland) on Wayland desktops","Offer a PipeWire portal capture path as the Wayland alternative"],"tags":["linux","wayland","x11","ffmpeg","screen-recording"],"backgroundTag":"unsupported-platform","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}