aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-08-31 16:38:39 +0200
committerDrew DeVault <sir@cmpwn.com>2020-08-31 08:43:54 -0600
commit2b418b4d8857a4eacd719b76dfd36210383db6d6 (patch)
tree5a95f31a564201bee1086b093e7a02c53111b919
parentb0144c7ded2b655085eb8e7e9b64908dc9420d60 (diff)
examples/dmabuf-capture: add extra roundtrip for wl_output listener
This example was relying on wl_display_dispatch being enough to fetch output information. This worked by chance. Add an explicit wl_display_roundtrip. Other examples don't setup wl_output listeners, so they should be fine. Fixes: 297354f84772 ("Remove unnecessary wl_display_dispatch calls") Closes: https://github.com/swaywm/wlroots/issues/2386
-rw-r--r--examples/dmabuf-capture.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/dmabuf-capture.c b/examples/dmabuf-capture.c
index 2a3e195c..60cdb657 100644
--- a/examples/dmabuf-capture.c
+++ b/examples/dmabuf-capture.c
@@ -753,6 +753,10 @@ static int init(struct capture_context *ctx) {
ctx->registry = wl_display_get_registry(ctx->display);
wl_registry_add_listener(ctx->registry, &registry_listener, ctx);
+ // First roundtrip to fetch globals
+ wl_display_roundtrip(ctx->display);
+
+ // Second roundtrip to fetch wl_output information
wl_display_roundtrip(ctx->display);
if (!ctx->export_manager) {