From 768e81a0eb3ae411d108168fdff7cd3335f2a34a Mon Sep 17 00:00:00 2001 From: Jan Hendrik Farr Date: Fri, 31 May 2024 01:42:53 +0200 Subject: [PATCH] Wayland: Fix key repeat halting Key repeat shoud only be halted when the repeating key is released, not when another key is released. --- CONTRIBUTORS.md | 1 + README.md | 1 + src/wl_window.c | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8fa1cb72..295a4c47 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -68,6 +68,7 @@ video tutorials. - Jan Ekström - Siavash Eliasi - er-azh + - Jan Hendrik Farr - Ahmad Fatoum - Nikita Fediuchin - Felipe Ferreira diff --git a/README.md b/README.md index d1be3141..cebdf089 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over fallback decorations - [Wayland] Bugfix: Fallback decorations would report scroll events + - [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568) - [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631) - [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface` - [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless` diff --git a/src/wl_window.c b/src/wl_window.c index 0a6a8543..b33a2262 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1838,11 +1838,12 @@ static void keyboardHandleKey(void* userData, timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000; timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000; + timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); } + } else if (scancode == _glfw.wl.keyRepeatScancode) { + timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); } - timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL); - _glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers); if (action == GLFW_PRESS)