diff --git a/clients/window.c b/clients/window.c index 13363f80..91a2439f 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4118,6 +4118,8 @@ display_run(struct display *display) task->run(task, 0); } + wl_display_dispatch_pending(display->display); + if (!display->running) break; diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c index eed9d5c4..56759fc0 100644 --- a/src/compositor-wayland.c +++ b/src/compositor-wayland.c @@ -769,13 +769,19 @@ static int wayland_compositor_handle_event(int fd, uint32_t mask, void *data) { struct wayland_compositor *c = data; + int count = 0; if (mask & WL_EVENT_READABLE) - wl_display_dispatch(c->parent.wl_display); + count = wl_display_dispatch(c->parent.wl_display); if (mask & WL_EVENT_WRITABLE) wl_display_flush(c->parent.wl_display); - return 1; + if (mask == 0) { + count = wl_display_dispatch_pending(c->parent.wl_display); + wl_display_flush(c->parent.wl_display); + } + + return count; } static void @@ -856,6 +862,8 @@ wayland_compositor_create(struct wl_display *display, if (c->parent.wl_source == NULL) goto err_display; + wl_event_source_check(c->parent.wl_source); + return &c->base; err_display: