diff --git a/docs/changelog.rst b/docs/changelog.rst index a1a88c9d4..513992ddc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,9 @@ To update |kitty|, :doc:`follow the instructions `. - Preserve lines in the scrollback if a scrolling region is defined that is contiguous with the top of the screen (:iss:`3113`) +- Wayland: Fix key repeat being stopped by the release of an unrelated key + (:iss:`2191`) + 0.19.2 [2020-11-13] ------------------- diff --git a/glfw/wl_init.c b/glfw/wl_init.c index c14934a2f..ea99a05c1 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -446,7 +446,6 @@ static void keyboardHandleKey(void* data UNUSED, _glfw.wl.serial = serial; glfw_xkb_handle_key_event(window, &_glfw.wl.xkb, key, action); bool repeatable = false; - _glfw.wl.keyRepeatInfo.key = 0; if (action == GLFW_PRESS && _glfw.wl.keyboardRepeatRate > 0 && glfw_xkb_should_repeat(&_glfw.wl.xkb, key)) { @@ -456,8 +455,11 @@ static void keyboardHandleKey(void* data UNUSED, } if (repeatable) { changeTimerInterval(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer, _glfw.wl.keyboardRepeatDelay); + toggleTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer, 1); + } else if (action == GLFW_RELEASE && key == _glfw.wl.keyRepeatInfo.key) { + _glfw.wl.keyRepeatInfo.key = 0; + toggleTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer, 0); } - toggleTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer, repeatable ? 1 : 0); } static void keyboardHandleModifiers(void* data UNUSED,