wayland: Fix string printing from keyboard handler

This commit is contained in:
2026-03-09 09:46:35 +01:00
parent 20ca6cd891
commit 8e66f13c85
+9 -1
View File
@@ -671,7 +671,15 @@ fn wlKeyboardHandleKey(data: ?*anyopaque, keyboard: ?*c.wl_keyboard, serial: u32
const pressed = state == c.WL_KEYBOARD_KEY_STATE_PRESSED or state == c.WL_KEYBOARD_KEY_STATE_REPEATED;
std.debug.print("{s} {any}\n", .{ buf, pressed });
const buf_end: usize = blk: {
var i: usize = 0;
while (buf[i] != 0) {
i += 1;
}
break :blk i;
};
const str: []const u8 = buf[0 .. buf_end];
std.debug.print("{s} {any}\n", .{ str, pressed });
switch (sym) {
c.XKB_KEY_Escape => {