mirror of
https://github.com/glfw/glfw.git
synced 2026-08-29 03:04:14 +02:00
Wayland: Fix repeated keys reported to NULL window
This fixes a race between the key repeat logic and the surface leave event handler, which could result in repeated keys being reported with a window of NULL. Fixes #1704.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user