aboutsummaryrefslogtreecommitdiffstats
path: root/src/wayland-client.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-10-11 17:15:08 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-10-15 10:52:53 -0400
commit78cfa967681c965d23f6cbf76e080bbb0b564ff6 (patch)
tree91642db1cba35ecdea52c8ecdc1fe7b4681fdbc1 /src/wayland-client.h
parentclient: Discard proxies with no implementation at dispatch time (diff)
downloadwayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar.gz
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar.bz2
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar.lz
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar.xz
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.tar.zst
wayland-78cfa967681c965d23f6cbf76e080bbb0b564ff6.zip
client: Add wl_display_dispatch_pending() for dispatching without reading
If the main thread ends up dispatching a non-main queue, and not in a wl_display_dispatch() callback, we may queue up main queue events and read all data from the socket fd. When we get back to the main loop, the socket fd is no longer readable and nothing will trigger dispatching of the queued up events. The new function wl_display_dispatch_pending() will dispatch any pending events, but not attempt to read from the socket. Clients that integrate the wayland socket fd into a main loop should call wl_display_dispatch_pending() and then wl_display_flush() before going back to blocking in poll(2) or similar mechanism.
Diffstat (limited to 'src/wayland-client.h')
-rw-r--r--src/wayland-client.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wayland-client.h b/src/wayland-client.h
index cb1be9c..a73566e 100644
--- a/src/wayland-client.h
+++ b/src/wayland-client.h
@@ -60,6 +60,7 @@ int wl_display_get_fd(struct wl_display *display);
int wl_display_dispatch(struct wl_display *display);
int wl_display_dispatch_queue(struct wl_display *display,
struct wl_event_queue *queue);
+int wl_display_dispatch_pending(struct wl_display *display);
int wl_display_flush(struct wl_display *display);
void wl_display_roundtrip(struct wl_display *display);