vo_dmabuf_wayland: commit surfaces in correct order

osd_surface is a sync sub-surface of video_surface meaning that a commit
of osd_surface will not take effect until the next commit of
video_surface.

Some compositors (wlroots) do not implement sync sub-surface correctly,
meaning that the difference cannot be observed there. But it can easily
be seen on Jay and GNOME:

1. Open an mpv window.
2. Pause the video.
3. Enter the surface with the mouse.

Expected behavior:

1. The OSD shows up immediately.

Actual behavior:

1. Nothing happens for a few seconds.
2. The OSD shows up and immediately fades out.

This is because the fade-out commits cause the initial osd_surface
commit to become effective.
This commit is contained in:
Julian Orth authored and Dudemanguy committed 2025-02-21 17:23:56 +00:00
1 parent b90c1bb21b
commit 76da05092b
1 file changed
+1 -1
+1 -1
View File
@@ -649,8 +649,8 @@ static void flip_page(struct vo *vo)
{
struct vo_wayland_state *wl = vo->wl;
wl_surface_commit(wl->video_surface);
wl_surface_commit(wl->osd_surface);
wl_surface_commit(wl->video_surface);
wl_surface_commit(wl->surface);
if (wl->opts->wl_internal_vsync)