Wayland: Only use key repeat events from server is repeat rate == 0
Some checks are pending
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run

Fixes #10070
This commit is contained in:
Kovid Goyal 2026-05-26 08:31:52 +05:30
parent a20ea1b96a
commit 2096948cbc
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

7
glfw/wl_init.c vendored
View file

@ -325,7 +325,7 @@ static void keyboardHandleKeymap(void* data UNUSED,
}
static bool
needs_synthetic_key_repeat(void) { return _glfw.wl.keyboardRepeatRate > 0 && !_glfw.wl.has_key_repeat_events; }
needs_synthetic_key_repeat(void) { return _glfw.wl.keyboardRepeatRate > 0; }
static void
start_key_repeat_timer(bool initial) {
@ -416,7 +416,10 @@ static void keyboardHandleKey(void* data UNUSED,
case WL_KEYBOARD_KEY_STATE_PRESSED: action = GLFW_PRESS; break;
case WL_KEYBOARD_KEY_STATE_RELEASED: action = GLFW_RELEASE; break;
#ifdef WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION
case WL_KEYBOARD_KEY_STATE_REPEATED: action = GLFW_REPEAT; break;
case WL_KEYBOARD_KEY_STATE_REPEATED:
if (needs_synthetic_key_repeat()) return;
action = GLFW_REPEAT;
break;
#endif
}