From: Alexandros Frantzis alexandros.frantzis@collabora.com
Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com --- dlls/winewayland.drv/wayland.c | 10 ++++++++++ dlls/winewayland.drv/waylanddrv.h | 1 + 2 files changed, 11 insertions(+)
diff --git a/dlls/winewayland.drv/wayland.c b/dlls/winewayland.drv/wayland.c index 4974bd4e3b3..7e303c19e4e 100644 --- a/dlls/winewayland.drv/wayland.c +++ b/dlls/winewayland.drv/wayland.c @@ -312,6 +312,8 @@ static BOOL wayland_dispatch_thread_events(struct wayland_thread_data *thread, } pthread_mutex_unlock(&thread->event_mutex);
+ thread->processing_events = TRUE; + /* Now handle matching events without any lock held. */ wl_list_for_each_safe(event, tmp, &event_list, link) { @@ -321,6 +323,8 @@ static BOOL wayland_dispatch_thread_events(struct wayland_thread_data *thread, free(event); }
+ thread->processing_events = FALSE; + wl_display_flush(process_wl_display);
TRACE("=> dispatched=0x%lx\n", (long)dispatched); @@ -337,6 +341,12 @@ BOOL WAYLAND_ProcessEvents(DWORD mask)
if (!thread) return FALSE;
+ if (thread->processing_events) + { + wl_display_flush(process_wl_display); + return FALSE; + } + wayland_consume_thread_notifications(thread); return wayland_dispatch_thread_events(thread, mask); } diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index 88dc31967be..c693034b013 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -93,6 +93,7 @@ struct wayland_thread_data pthread_mutex_t event_mutex; struct wl_list event_list; int event_notification_pipe[2]; + BOOL processing_events; };
/**********************************************************************