From 0a03434656d064163428cbb180bf4a5880e70064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bulteel?= Date: Sun, 2 Nov 2025 14:09:54 +0100 Subject: [PATCH] gtk: fix xkb mapping not working on linux Signed-off-by: Cedric BULTEEL --- src/apprt/gtk/class/surface.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/apprt/gtk/class/surface.zig b/src/apprt/gtk/class/surface.zig index fcbfbe6ab..09d82fe5c 100644 --- a/src/apprt/gtk/class/surface.zig +++ b/src/apprt/gtk/class/surface.zig @@ -1137,13 +1137,14 @@ pub const Surface = extern struct { if (entry.native == keycode) break :w3c entry.key; } else .unidentified; - // If the key should be remappable, then consult the pre-remapped - // XKB keyval/keysym to get the (possibly) remapped key. + // Consult the pre-remapped XKB keyval/keysym to get the (possibly) + // remapped key. If the W3C key or the remapped key + // is eligible for remapping, we use it. // // See the docs for `shouldBeRemappable` for why we even have to // do this in the first place. - if (w3c_key.shouldBeRemappable()) { - if (gtk_key.keyFromKeyval(keyval)) |remapped| + if (gtk_key.keyFromKeyval(keyval)) |remapped| { + if (w3c_key.shouldBeRemappable() or remapped.shouldBeRemappable()) break :keycode remapped; }