zed-industries/zed · error
Failed to initialize XDP event source: {err:?}
Error message
Failed to initialize XDP event source: {err:?} What it means
Raised in X11Client::new: calloop failed to register the xdg-desktop-portal event source (appearance changes, button layout) with the event loop. {err:?} is the calloop InsertError; the client would otherwise miss theme and decoration updates.
Source
Thrown at crates/gpui_linux/src/linux/x11/client.rs:526
for window in client.0.borrow_mut().windows.values_mut() {
window.window.set_appearance(appearance);
}
}
XDPEvent::ButtonLayout(layout_str) => {
let layout = WindowButtonLayout::parse(&layout_str)
.log_err()
.unwrap_or_else(WindowButtonLayout::linux_default);
client.with_common(|common| common.button_layout = layout);
for window in client.0.borrow_mut().windows.values_mut() {
window.window.set_button_layout();
}
}
XDPEvent::CursorTheme(_) | XDPEvent::CursorSize(_) => {
// noop, X11 manages this for us.
}
}
})
.map_err(|err| anyhow!("Failed to initialize XDP event source: {err:?}"))?;
xcb_flush(&xcb_connection);
Ok(X11Client(Rc::new(RefCell::new(X11ClientState {
modifiers: Modifiers::default(),
capslock: Capslock::default(),
last_modifiers_changed_event: Modifiers::default(),
last_capslock_changed_event: Capslock::default(),
event_loop: Some(event_loop),
loop_handle: handle,
common,
last_click: Instant::now(),
last_mouse_button: None,
last_location: Point::new(px(0.0), px(0.0)),
current_count: 0,
pinch_scale: 1.0,
gpu_context: Rc::new(RefCell::new(None)),
compositor_gpu,View on GitHub (pinned to 9d272b0363)
Solutions
- Inspect the InsertError from inserting the XDP channel source
- Ensure the XDP event channel is created once and its receiver not moved or dropped before registration
- Consider making XDP optional: log and continue without desktop-portal integration if registration fails
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at crates/gpui_linux/src/linux/x11/client.rs:511 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/f00c631017c58b3d.
Report an issue: GitHub.