From 33ff23dc076bd0d023ff415716f1bb0a8bf0eb62 Mon Sep 17 00:00:00 2001 From: Koray Kilinc Date: Tue, 1 Jun 2021 13:40:44 -0700 Subject: [PATCH] Wayland: Fix some keys not repeating According to the libxkbcommon documentation[1], xkb_keymap_key_repeats requires keymap and keycode as input: int xkb_keymap_key_repeats( struct xkb_keymap * keymap, xkb_keycode_t key) However, in inputChar in wl_input.c we are passing in xkb_keysym_t, which was a type mismatch. This results in some keys not repeating when they should and vice versa. [1] https://xkbcommon.org/doc/current/group__components.html#ga9d7f998efeca98b3afc7c257bbac90a8 Closes #1908. (cherry picked from commit 216d5e8402513b582563d5b8433fefb449a1593e) --- README.md | 2 ++ src/wl_init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index be64bfab..40dce879 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ information on what to include when reporting a bug. - [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after related events were emitted - [X11] Bugfix: Changing `GLFW_FLOATING` could leak memory + - [Wayland] Bugfix: Some keys were not repeating in Wayland (#1908) - [NSGL] Bugfix: Defining `GL_SILENCE_DEPRECATION` externally caused a duplicate definition warning (#1840) - [EGL] Bugfix: The `GLFW_DOUBLEBUFFER` context attribute was ignored (#1843) @@ -228,6 +229,7 @@ skills. - Arseny Kapoulkine - Cem Karan - Osman Keskin + - Koray Kilinc - Josh Kilmer - Byunghoon Kim - Cameron King diff --git a/src/wl_init.c b/src/wl_init.c index 3d48702b..08ceeada 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -560,7 +560,7 @@ static GLFWbool inputChar(_GLFWwindow* window, uint32_t key) } } - return xkb_keymap_key_repeats(_glfw.wl.xkb.keymap, syms[0]); + return xkb_keymap_key_repeats(_glfw.wl.xkb.keymap, code); } static void keyboardHandleKey(void* data,