wayland: use non-blocking read_events for client dispatch
The poll-based wlclient_dispatch with timeout 0 missed events that were already buffered. Use prepare_read/read_events/dispatch_pending which reads whatever is available on the socket without polling.
This commit is contained in:
parent
fe2ec1fb9e
commit
d522fc87c5
|
|
@ -1191,8 +1191,12 @@ wlclient_dispatch(int timeout_ms, void *userdata)
|
|||
* main loop. */
|
||||
void W_WLClientDispatchPending(void)
|
||||
{
|
||||
if (g_wlclient_ctx)
|
||||
wlclient_dispatch(0, g_wlclient_ctx);
|
||||
if (!g_wlclient_ctx || !g_wlclient_ctx->display) return;
|
||||
/* Read any pending data from the socket and dispatch events */
|
||||
while (wl_display_prepare_read(g_wlclient_ctx->display) != 0)
|
||||
wl_display_dispatch_pending(g_wlclient_ctx->display);
|
||||
wl_display_read_events(g_wlclient_ctx->display);
|
||||
wl_display_dispatch_pending(g_wlclient_ctx->display);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
|
|
|||
Loading…
Reference in New Issue