{"record":{"id":"3184f81e43d9e7ea","repo":"zed-industries/zed","slug":"failed-to-create-desktop-capturer-check-that-xdg","errorCode":null,"errorMessage":"Failed to create desktop capturer. Check that xdg-desktop-portal is installed and running.","messagePattern":"Failed to create desktop capturer\\. Check that xdg-desktop-portal is installed and running\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/livekit_client/src/livekit_client/linux.rs","lineNumber":87,"sourceCode":"\n    fn webrtc_log_callback(message: String, severity: webrtc_ffi::LoggingSeverity) {\n        match severity {\n            webrtc_ffi::LoggingSeverity::Error => log::error!(\"[webrtc] {}\", message.trim()),\n            _ => log::debug!(\"[webrtc] {}\", message.trim()),\n        }\n    }\n\n    let _webrtc_log_sink = webrtc_ffi::new_log_sink(webrtc_log_callback);\n    log::debug!(\"Wayland desktop capture: WebRTC internal logging enabled\");\n\n    let stop_flag = Arc::new(AtomicBool::new(false));\n    let (mut video_source_tx, mut video_source_rx) = mpsc::channel::<NativeVideoSource>(1);\n    let (failure_tx, failure_rx) = oneshot::channel::<()>();\n\n    let mut options = DesktopCapturerOptions::new(DesktopCaptureSourceType::Generic);\n    options.set_include_cursor(true);\n    let mut capturer = DesktopCapturer::new(options).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"Failed to create desktop capturer. \\\n             Check that xdg-desktop-portal is installed and running.\"\n        )\n    })?;\n\n    let permanent_error = Arc::new(AtomicBool::new(false));\n    let stop_cb = stop_flag.clone();\n    let permanent_error_cb = permanent_error.clone();\n    capturer.start_capture(None, {\n        let mut video_source: Option<NativeVideoSource> = None;\n        let mut current_width: u32 = 0;\n        let mut current_height: u32 = 0;\n        let mut video_frame = VideoFrame {\n            rotation: VideoRotation::VideoRotation0,\n            buffer: NV12Buffer::new(1, 1),\n            timestamp_us: 0,\n        };\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/livekit_client/src/livekit_client/linux.rs#L69-L105","documentation":"Startup failure in start_wayland_desktop_capture: the WebRTC desktop capturer object could not be created on Linux/Wayland, almost always because xdg-desktop-portal (with the screencast backend) is missing or not running, so screen sharing cannot begin at all.","triggerScenarios":"Thrown at crates/livekit_client/src/livekit_client/linux.rs:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install xdg-desktop-portal and the portal backend matching your compositor (e.g. xdg-desktop-portal-gnome/-kde/-wlroots)","Ensure the portal and PipeWire services are running (systemctl --user status xdg-desktop-portal pipewire)","Fall back to an X11/XWayland session if Wayland capture cannot be set up"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}