From f3e7afa3ff2f00eb23eaff034321eb26baa1b34c Mon Sep 17 00:00:00 2001 From: Koray Kilinc Date: Tue, 1 Jun 2021 13:40:44 -0700 Subject: [PATCH] Fix some keys not repeating in Wayland According to https://xkbcommon.org/doc/current/group__components.html#ga9d7f998efeca98b3afc7c257bbac90a8, 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 wl_init.c:inputChar, 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. --- README.md | 2 ++ src/wl_init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b5b4f7ea..a3ce6f89 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder (#1798) - [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792) + - [Wayland] Bugfix: Some keys were not repeating in Wayland - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer @@ -472,6 +473,7 @@ skills. - Jonas Ådahl - Lasse Öörni - Leonard König + - Koray Kilinc - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/src/wl_init.c b/src/wl_init.c index 21a808aa..c69ca256 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -552,7 +552,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,