{"record":{"id":"6a8e54757cf36b96","repo":"linebender/druid","slug":"only-xkb-keymap-supported-for-now","errorCode":null,"errorMessage":"only xkb keymap supported for now","messagePattern":"only xkb keymap supported for now","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/wayland/keyboard.rs","lineNumber":141,"sourceCode":"        );\n        event.mods = self.xkb_mods.get();\n\n        if let Err(cause) = keystroke.queue.send(event) {\n            tracing::error!(\"failed to send Druid key event: {:?}\", cause);\n        }\n    }\n\n    fn consume(\n        &mut self,\n        seat: u32,\n        event: wl_keyboard::Event,\n        keyqueue: calloop::channel::Sender<KeyEvent>,\n    ) {\n        tracing::trace!(\"consume {:?} -> {:?}\", seat, event);\n        match event {\n            wl_keyboard::Event::Keymap { format, fd, size } => {\n                if !matches!(format, wl_keyboard::KeymapFormat::XkbV1) {\n                    panic!(\"only xkb keymap supported for now\");\n                }\n\n                // TODO to test memory ownership we copy the memory. That way we can deallocate it\n                // and see if we get a segfault.\n                let keymap_data = unsafe {\n                    buffers::Mmap::from_raw_private(\n                        fd,\n                        size.try_into().unwrap(),\n                        0,\n                        size.try_into().unwrap(),\n                    )\n                    .unwrap()\n                    .as_ref()\n                    .to_vec()\n                };\n\n                // keymap data is '\\0' terminated.\n                let keymap = self.xkb_context.keymap_from_slice(&keymap_data);","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/wayland/keyboard.rs#L123-L159","documentation":"Guard in the wayland keyboard handler: when the compositor sends a wl_keyboard keymap event whose format is not XkbV1, the backend cannot build an xkb keymap and aborts. It fires when connecting to a compositor that advertises a non-xkb keymap format (e.g. no_keymap or a future format); druid-shell only implements xkb keymap decoding.","triggerScenarios":"The Wayland compositor advertises a `KeymapFormat` other than `XkbV1` in the `wl_keyboard::Event::Keymap` event handled by `consume`.","commonSituations":"Unusual or minimal compositors, remote/desktop-sharing setups, or alternative keyboard backends that do not provide an xkb keymap.","solutions":["Run under a compositor that provides xkb v1 keymaps (standard wlroots/GNOME/KDE compositors)","Implement keymap-format fallback handling (e.g. `NoKeymap`) in the backend","File/update an upstream issue; treat the panic site as the extension point"],"exampleFix":"// before\nif !matches!(format, wl_keyboard::KeymapFormat::XkbV1) {\n    panic!(\"only xkb keymap supported for now\");\n}\n\n// after\nif format != wl_keyboard::KeymapFormat::XkbV1 {\n    tracing::warn!(\"non-xkb keymap unsupported; ignoring\");\n    return;\n}","handlingStrategy":"validation","validationCode":"if keymap_format != wl_keyboard::KeymapFormat::XkbV1 { /* skip or fallback before calling consume */ }","typeGuard":"fn is_xkb_v1(f: wl_keyboard::KeymapFormat) -> bool { matches!(f, wl_keyboard::KeymapFormat::XkbV1) }","tryCatchPattern":null,"preventionTips":["Deploy only on compositors advertising XkbV1 keymaps (virtually all mainstream ones)","Check the compositor's keyboard protocol support before running the app","Contribute/implement a NoKeymap fallback path for exotic environments"],"tags":["wayland","keyboard","xkb","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"0f8b1195e4e073f9597f2865299c3d18f8e4005f","analyzedAt":"2026-09-10T14:27:34.582Z","contentChangedAt":"2026-09-10T14:27:34.582Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}