Skip to content

Commit 780f30e

Browse files
committed
wayland: block after creating image_desc to ensure it gets set
Previous commit fixed the problem that `set_color_management` would be called on every frame, however it didn't fix the problem that due to a lack of blocking, we'd end up doing events in the following order: -> wl_surface#9.commit() -> wp_color_management_surface_v1#45.set_image_description(...) -> wl_surface#9.commit() -> wp_color_management_surface_v1#45.set_image_description(...) This would mean the image description would always lag behind by 1 commit, and effectively the first frame would _always_ have no image description set. Fix this issue by blocking the thread until the compositor responds with a ready event and we call set_image_description.
1 parent ba348e2 commit 780f30e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

video/out/wayland_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,6 +3491,10 @@ static void set_color_management(struct vo_wayland_state *wl)
34913491
}
34923492
struct wp_image_description_v1 *image_description = wp_image_description_creator_params_v1_create(image_creator_params);
34933493
wp_image_description_v1_add_listener(image_description, &image_description_listener, wl);
3494+
3495+
/* Do a round trip to ensure the image description gets set before
3496+
* vo->driver->flip_page calls wl_surface_commit on us */
3497+
wl_display_roundtrip(wl->display);
34943498
#endif
34953499
}
34963500

0 commit comments

Comments
 (0)