mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 06:23:50 +00:00
Wayland: Continue poll() if timerfd can’t be read
In the case the key repeat timerfd was interrupted before read(), the
cursor timerfd wasn’t read at all even when it could.
Related to #1711
(cherry picked from commit 68879081cb
)
This commit is contained in:
parent
8f3677a0d4
commit
52133a3690
@ -123,7 +123,7 @@ information on what to include when reporting a bug.
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
There is nothing here yet.
|
- [Wayland] Bugfix: Key repeat could lead to a race condition (#1710)
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
@ -867,10 +867,7 @@ static void handleEvents(int timeout)
|
|||||||
if (fds[1].revents & POLLIN)
|
if (fds[1].revents & POLLIN)
|
||||||
{
|
{
|
||||||
read_ret = read(_glfw.wl.timerfd, &repeats, sizeof(repeats));
|
read_ret = read(_glfw.wl.timerfd, &repeats, sizeof(repeats));
|
||||||
if (read_ret != 8)
|
if (read_ret == 8 && _glfw.wl.keyboardFocus)
|
||||||
return;
|
|
||||||
|
|
||||||
if (_glfw.wl.keyboardFocus)
|
|
||||||
{
|
{
|
||||||
for (i = 0; i < repeats; ++i)
|
for (i = 0; i < repeats; ++i)
|
||||||
{
|
{
|
||||||
@ -886,9 +883,7 @@ static void handleEvents(int timeout)
|
|||||||
if (fds[2].revents & POLLIN)
|
if (fds[2].revents & POLLIN)
|
||||||
{
|
{
|
||||||
read_ret = read(_glfw.wl.cursorTimerfd, &repeats, sizeof(repeats));
|
read_ret = read(_glfw.wl.cursorTimerfd, &repeats, sizeof(repeats));
|
||||||
if (read_ret != 8)
|
if (read_ret == 8)
|
||||||
return;
|
|
||||||
|
|
||||||
incrementCursorImage(_glfw.wl.pointerFocus);
|
incrementCursorImage(_glfw.wl.pointerFocus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user