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:
Window Maker 2026-05-25 13:33:30 +02:00
parent fe2ec1fb9e
commit d522fc87c5
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}
/* ------------------------------------------------------------------ */