summaryrefslogtreecommitdiffstats
path: root/video/out/vo_wlshm.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-04-27 14:03:34 -0500
committerDudemanguy <random342@airmail.cc>2022-04-27 20:31:07 +0000
commit8a8580e05cbca61919e4ee431b7ec77cd11f6982 (patch)
treee180fa3045aab0d9e37a406c89c1de4e8f925b26 /video/out/vo_wlshm.c
parent6605b6d619b7812192823c5ac6a88def4e50da5e (diff)
downloadmpv-8a8580e05cbca61919e4ee431b7ec77cd11f6982.tar.bz2
mpv-8a8580e05cbca61919e4ee431b7ec77cd11f6982.tar.xz
wayland: use wl_surface_damage_buffer
Since 2018, wl_surface_damage_buffer has been explicitly preferred and recommended over wl_surface_damage*. mpv was still using the old function in a couple of spots. The only difference is that we need to pass buffer coordinates instead of surface coordinates. In vo_wlshm, this is done by using vo->dwidth/vo->dheight since that is always used whenever wl_buffers are created. In the case of the cursor surfaace, we actually already passed buffer coordinates to it (img->width/height) which was probablly technically wrong with wl_surface_damage, but it doesn't really matter in practice. This requires bumping wl_compositor to version 4 which is no problem since this dates back to 2015*. https://gitlab.freedesktop.org/wayland/wayland/-/commit/921d0548035673a1bf6aeb9396b9bc728133411e https://gitlab.freedesktop.org/wayland/wayland/-/commit/3384f69ecf043d62a4e036c0353c2daa01d7c4d0
Diffstat (limited to 'video/out/vo_wlshm.c')
-rw-r--r--video/out/vo_wlshm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c
index 7f0d03dcaf..2bcb340754 100644
--- a/video/out/vo_wlshm.c
+++ b/video/out/vo_wlshm.c
@@ -269,8 +269,8 @@ static void flip_page(struct vo *vo)
{
struct vo_wayland_state *wl = vo->wl;
- wl_surface_damage(wl->surface, 0, 0, mp_rect_w(wl->geometry),
- mp_rect_h(wl->geometry));
+ wl_surface_damage_buffer(wl->surface, 0, 0, vo->dwidth,
+ vo->dheight);
wl_surface_commit(wl->surface);
if (!wl->opts->disable_vsync)