From 76da05092b095cb4f3a670de1cbabbfdfe03a5c7 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Thu, 20 Feb 2025 11:52:37 +0100 Subject: [PATCH] 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. --- video/out/vo_dmabuf_wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index df0199c4ae..e77ae19198 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -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)