Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

linux: Fix crash when NoKeymap event is received on Wayland (#24379)

smit6534e0bafda9
diff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rs
index 624114b089b..5c5ab5a3929 100644
--- a/crates/gpui/src/platform/linux/wayland/client.rs
+++ b/crates/gpui/src/platform/linux/wayland/client.rs
@@ -1132,11 +1132,10 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for WaylandClientStatePtr {
size,
..
} => {
- assert_eq!(
- format,
- wl_keyboard::KeymapFormat::XkbV1,
- "Unsupported keymap format"
- );
+ if format != wl_keyboard::KeymapFormat::XkbV1 {
+ log::error!("Received keymap format {:?}, expected XkbV1", format);
+ return;
+ }
let xkb_context = xkb::Context::new(xkb::CONTEXT_NO_FLAGS);
let keymap = unsafe {
xkb::Keymap::new_from_fd(