{"record":{"id":"262ca5110ae75234","repo":"niri-wm/niri","slug":"no-x11-support","errorCode":null,"errorMessage":"no X11 support","messagePattern":"no X11 support","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/window/unmapped.rs","lineNumber":98,"sourceCode":"impl Unmapped {\n    /// Wraps a newly created window that hasn't been initially configured yet.\n    pub fn new(window: Window) -> Self {\n        Self {\n            window,\n            state: InitialConfigureState::NotConfigured {\n                wants_fullscreen: None,\n                wants_maximized: false,\n            },\n            activation_token_data: None,\n        }\n    }\n\n    pub fn needs_initial_configure(&self) -> bool {\n        matches!(self.state, InitialConfigureState::NotConfigured { .. })\n    }\n\n    pub fn toplevel(&self) -> &ToplevelSurface {\n        self.window.toplevel().expect(\"no X11 support\")\n    }\n}\n","sourceCodeStart":80,"sourceCodeEnd":101,"githubUrl":"https://github.com/niri-wm/niri/blob/606284464d4a99bb35710fee68192bc71085ee7c/src/window/unmapped.rs#L80-L101","documentation":"Unmapped wraps a newly created window between creation and its initial xdg configure. toplevel() unwraps Window::toplevel(), which returns Some only for Wayland xdg_shell toplevels and None for X11 (Xwayland) windows — hence the message 'no X11 support'. X11 windows are not supposed to enter the unmapped map at all, so this expect firing means an X11 window reached a Wayland-only code path: an internal invariant violation (bug), and it panics the compositor.","triggerScenarios":"An Xwayland client's window being inserted into the Unmapped flow (the map keyed for new windows awaiting initial configure) — e.g. a regression in how X11 windows are routed during map/unmap, typically triggered by starting or closing an X11 app under Xwayland.","commonSituations":"Hitting a niri bug after an update when an X app (or one run via xwayland-satellite style paths) maps a window; race conditions around Xwayland startup at session start; building niri from a dev branch with incomplete X11 handling.","solutions":["Update niri — invariant panics on X11 windows are bug fixes (check the issue tracker for 'no X11 support' backtraces).","Capture the backtrace from the crash log (journalctl --user -u niri or stderr) and report it with the exact X11 app that triggered it.","As a workaround, avoid the triggering app or run X11 apps through a translation layer (xwayland-satellite) instead of direct Xwayland mapping.","If developing against niri sources, ensure X11 windows bypass the unmapped/initial-configure path (only xdg toplevels should be wrapped in Unmapped::new)."],"exampleFix":"// before: panics if an X11 window ever gets wrapped\npub fn toplevel(&self) -> &ToplevelSurface {\n    self.window.toplevel().expect(\"no X11 support\")\n}\n\n// after: keep the invariant at construction instead — only wrap xdg toplevels\nif let Some(_toplevel) = window.toplevel() {\n    unmapped.insert(Unmapped::new(window.clone()));\n}","handlingStrategy":"type-guard","validationCode":"// Rust: only wrap windows that can receive an xdg initial configure\nif window.toplevel().is_some() {\n    unmapped.insert(Unmapped::new(window.clone()));\n} else {\n    debug!(\"skipping unmapped tracking for non-xdg window (X11)\");\n}","typeGuard":"fn as_xdg_toplevel(window: &smithay::desktop::Window) -> Option<&ToplevelSurface> {\n    window.toplevel() // Some only for Wayland xdg_shell toplevels, None for X11 windows\n}","tryCatchPattern":"let toplevel = self\n    .window\n    .toplevel()\n    .ok_or_else(|| anyhow!(\"window has no xdg toplevel (X11 windows never reach the unmapped state)\"))?;\n// returning Err instead of expect keeps the compositor alive and the bug reportable","preventionTips":["Treat this panic as a niri bug: capture the backtrace and the X11 app that triggered it, then report upstream.","Keep niri updated — X11 window-routing regressions are fixed quickly once reported.","When hacking on niri/smithay, assert the Wayland-only invariant at Unmapped::new instead of at every toplevel() call site.","Reproduce deterministically (same X11 app, same close/reopen sequence) before filing."],"tags":["x11","xwayland","wayland","panic","invariant","window-mapping","bug"],"backgroundTag":"invariant-panic","analyzedSha":"606284464d4a99bb35710fee68192bc71085ee7c","analyzedAt":"2026-08-16T21:48:00.228Z","schemaVersion":2},"datasetVersion":"2026-08-18T00:17:09.346Z"}