mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
Wayland: Fix heuristics for what counts as events
The Wayland implementation of glfwWaitEvents* keeps waiting until it sees evidence that a significant event has been processed. However, this included updating an animated cursor (not a significant event) but did not include previously buffered Wayland events or libdecor events (definitely significant events). This commit corrects these cases.
This commit is contained in:
parent
23e40548b1
commit
d097e35743
@ -1118,7 +1118,10 @@ static void handleEvents(double* timeout)
|
|||||||
while (!event)
|
while (!event)
|
||||||
{
|
{
|
||||||
while (wl_display_prepare_read(_glfw.wl.display) != 0)
|
while (wl_display_prepare_read(_glfw.wl.display) != 0)
|
||||||
wl_display_dispatch_pending(_glfw.wl.display);
|
{
|
||||||
|
if (wl_display_dispatch_pending(_glfw.wl.display) > 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If an error other than EAGAIN happens, we have likely been disconnected
|
// If an error other than EAGAIN happens, we have likely been disconnected
|
||||||
// from the Wayland session; try to handle that the best we can.
|
// from the Wayland session; try to handle that the best we can.
|
||||||
@ -1176,14 +1179,14 @@ static void handleEvents(double* timeout)
|
|||||||
uint64_t repeats;
|
uint64_t repeats;
|
||||||
|
|
||||||
if (read(_glfw.wl.cursorTimerfd, &repeats, sizeof(repeats)) == 8)
|
if (read(_glfw.wl.cursorTimerfd, &repeats, sizeof(repeats)) == 8)
|
||||||
{
|
|
||||||
incrementCursorImage(_glfw.wl.pointerFocus);
|
incrementCursorImage(_glfw.wl.pointerFocus);
|
||||||
event = GLFW_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fds[3].revents & POLLIN)
|
if (fds[3].revents & POLLIN)
|
||||||
libdecor_dispatch(_glfw.wl.libdecor.context, 0);
|
{
|
||||||
|
if (libdecor_dispatch(_glfw.wl.libdecor.context, 0) > 0)
|
||||||
|
event = GLFW_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user