-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Wayland requires clients (applications) to handle keyboard repeat events themselves. The GLFW implementation does so during the event loop, however the current implementation does not reset the key repeat timer when a window is destroyed.
This looks like the actual likely cause of issue #2727 with a workaround fix in merged PR #2732 which ignores repeats when no window has focus. This could result in lost events and potentially an application with multiple GLFW windows receiving key repeat events to the wrong window.
This is related to #2736.
To observe this issue I used a version of GLFW prior to PR #2732 and altered events.c to create 2 windows, added a sleep(1) in the loop and auto-closed the first window after 10 seconds. Running this and clicking on the first window to appear to get keyboard focus and then holding down a key will result in key repeat events followed by an assert:
000002b7 to 1 at 12.183: Key 0x0044 (D) Scancode 0x0020 Name d (with no mods) was repeated
000002b8 to 1 at 12.183: Character 0x00000064 (d) input
000002b9 to 1 at 12.183: Key 0x0044 (D) Scancode 0x0020 Name d (with no mods) was repeated
000002ba to 1 at 12.183: Character 0x00000064 (d) input
000002bb to 1 at 12.183: Key 0x0044 (D) Scancode 0x0020 Name d (with no mods) was repeated
000002bc to 1 at 12.183: Character 0x00000064 (d) input
events: /redacted/glfw/src/input.c:274: _glfwInputKey: Assertion `window != NULL' failed.
dddddddAborted (core dumped)
I am currently working on a fix for this issue.