diff options
author | Ran Benita <ran234@gmail.com> | 2013-09-11 19:05:32 +0300 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2013-09-12 13:04:51 +0200 |
commit | ca22b38421c2f80b9669c4f7522359cc9e1753ce (patch) | |
tree | 4f1ab88b2e446bdd66f344136d828194a19ca422 /src | |
parent | a4ed3959d8adece59c31e08fd75758cb4cd4d987 (diff) |
wlt: toolkit: flush display after wl_display_dispatch_pending()
wlterm doesn't work with current Wayland/Weston; the events are never
sent and the window doesn't come up. We need to flush the display, as
per wl_display_dispatch_pending(3):
To proper integrate the wayland display fd into a main loop, the
client should always call wl_display_dispatch_pending() and then
wl_display_flush() prior to going back to sleep.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/wlt_toolkit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wlt_toolkit.c b/src/wlt_toolkit.c index f2a118f..ef036dd 100644 --- a/src/wlt_toolkit.c +++ b/src/wlt_toolkit.c @@ -405,10 +405,13 @@ static void dp_dispatch(struct wlt_display *disp, bool nonblock) int ret; errno = 0; - if (nonblock) + if (nonblock) { ret = wl_display_dispatch_pending(disp->dp); - else + if (ret != -1) + ret = wl_display_flush(disp->dp); + } else { ret = wl_display_dispatch(disp->dp); + } if (ret == -1) { log_error("error during wayland dispatch (%d): %m", errno); |