diff --git a/README.md b/README.md index 387f14c1..4eccb828 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ information on what to include when reporting a bug. - [Wayland] Removed support for `wl_shell` (#1443) - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled + - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704) - [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 @@ -398,6 +399,7 @@ skills. - Torsten Walluhn - Patrick Walton - Xo Wang + - Waris - Jay Weisskopf - Frank Wille - Ryogo Yoshimura diff --git a/src/wl_window.c b/src/wl_window.c index a6d5569c..f5d314f3 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -749,10 +749,17 @@ static void handleEvents(int timeout) if (read_ret != 8) return; - for (i = 0; i < repeats; ++i) - _glfwInputKey(_glfw.wl.keyboardFocus, _glfw.wl.keyboardLastKey, - _glfw.wl.keyboardLastScancode, GLFW_REPEAT, - _glfw.wl.xkb.modifiers); + if (_glfw.wl.keyboardFocus) + { + for (i = 0; i < repeats; ++i) + { + _glfwInputKey(_glfw.wl.keyboardFocus, + _glfw.wl.keyboardLastKey, + _glfw.wl.keyboardLastScancode, + GLFW_REPEAT, + _glfw.wl.xkb.modifiers); + } + } } if (fds[2].revents & POLLIN)