clients: Use wl_display_dispatch_pending()
This commit is contained in:
@@ -4118,6 +4118,8 @@ display_run(struct display *display)
|
|||||||
task->run(task, 0);
|
task->run(task, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_display_dispatch_pending(display->display);
|
||||||
|
|
||||||
if (!display->running)
|
if (!display->running)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -769,13 +769,19 @@ static int
|
|||||||
wayland_compositor_handle_event(int fd, uint32_t mask, void *data)
|
wayland_compositor_handle_event(int fd, uint32_t mask, void *data)
|
||||||
{
|
{
|
||||||
struct wayland_compositor *c = data;
|
struct wayland_compositor *c = data;
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
if (mask & WL_EVENT_READABLE)
|
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)
|
if (mask & WL_EVENT_WRITABLE)
|
||||||
wl_display_flush(c->parent.wl_display);
|
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
|
static void
|
||||||
@@ -856,6 +862,8 @@ wayland_compositor_create(struct wl_display *display,
|
|||||||
if (c->parent.wl_source == NULL)
|
if (c->parent.wl_source == NULL)
|
||||||
goto err_display;
|
goto err_display;
|
||||||
|
|
||||||
|
wl_event_source_check(c->parent.wl_source);
|
||||||
|
|
||||||
return &c->base;
|
return &c->base;
|
||||||
|
|
||||||
err_display:
|
err_display:
|
||||||
|
|||||||
Reference in New Issue
Block a user