diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index 83240ad..8001b66 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -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); } /* ------------------------------------------------------------------ */