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 caps lock not working consistently for certain X11 systems (#35361)

Smit Barmasecdce3b362045
diff --git a/crates/gpui/src/platform/linux/x11/client.rs b/crates/gpui/src/platform/linux/x11/client.rs
index d1cb7d00cc7..16a7a768e2a 100644
--- a/crates/gpui/src/platform/linux/x11/client.rs
+++ b/crates/gpui/src/platform/linux/x11/client.rs
@@ -1004,12 +1004,13 @@ impl X11Client {
let mut keystroke = crate::Keystroke::from_xkb(&state.xkb, modifiers, code);
let keysym = state.xkb.key_get_one_sym(code);
- // should be called after key_get_one_sym
- state.xkb.update_key(code, xkbc::KeyDirection::Down);
-
if keysym.is_modifier_key() {
return Some(());
}
+
+ // should be called after key_get_one_sym
+ state.xkb.update_key(code, xkbc::KeyDirection::Down);
+
if let Some(mut compose_state) = state.compose_state.take() {
compose_state.feed(keysym);
match compose_state.status() {
@@ -1067,12 +1068,13 @@ impl X11Client {
let keystroke = crate::Keystroke::from_xkb(&state.xkb, modifiers, code);
let keysym = state.xkb.key_get_one_sym(code);
- // should be called after key_get_one_sym
- state.xkb.update_key(code, xkbc::KeyDirection::Up);
-
if keysym.is_modifier_key() {
return Some(());
}
+
+ // should be called after key_get_one_sym
+ state.xkb.update_key(code, xkbc::KeyDirection::Up);
+
keystroke
};
drop(state);