From f0b04f1ef15685d4f63d0b55004bd1ea3bcfc41c Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 13 Dec 2021 13:16:06 +0100 Subject: [PATCH] waylandsink: Use wl_surface_damage_buffer() instead of wl_surface_damage() The later, doing damage in surface coordinates instead of buffer coordinates, has been deprecated. The reason for that is that it is more prone to bugs, both on the client and the compositor side, especially when paired with buffer scale, `wp_viewporter` or buffer transforms. Unfortunately, on Weston this risks running into https://gitlab.freedesktop.org/wayland/weston/-/issues/446 (which causes trouble for several other projects as well). However, that bug only affects cases where we run in sync mode, i.e. only during resizes. In practise I haven't been able to observe the issue. Part-of: --- subprojects/gst-plugins-bad/ext/wayland/wldisplay.c | 2 +- subprojects/gst-plugins-bad/ext/wayland/wlwindow.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/wayland/wldisplay.c b/subprojects/gst-plugins-bad/ext/wayland/wldisplay.c index 0bb9dc7..f326091 100644 --- a/subprojects/gst-plugins-bad/ext/wayland/wldisplay.c +++ b/subprojects/gst-plugins-bad/ext/wayland/wldisplay.c @@ -214,7 +214,7 @@ registry_handle_global (void *data, struct wl_registry *registry, if (g_strcmp0 (interface, "wl_compositor") == 0) { self->compositor = wl_registry_bind (registry, id, &wl_compositor_interface, - MIN (version, 3)); + MIN (version, 4)); } else if (g_strcmp0 (interface, "wl_subcompositor") == 0) { self->subcompositor = wl_registry_bind (registry, id, &wl_subcompositor_interface, 1); diff --git a/subprojects/gst-plugins-bad/ext/wayland/wlwindow.c b/subprojects/gst-plugins-bad/ext/wayland/wlwindow.c index 152b94e..7abddd5 100644 --- a/subprojects/gst-plugins-bad/ext/wayland/wlwindow.c +++ b/subprojects/gst-plugins-bad/ext/wayland/wlwindow.c @@ -451,7 +451,7 @@ gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, if (G_LIKELY (buffer)) { gst_wl_buffer_attach (buffer, window->video_surface_wrapper); - wl_surface_damage (window->video_surface_wrapper, 0, 0, G_MAXINT32, + wl_surface_damage_buffer (window->video_surface_wrapper, 0, 0, G_MAXINT32, G_MAXINT32); wl_surface_commit (window->video_surface_wrapper); } else { @@ -512,7 +512,7 @@ gst_wl_window_update_borders (GstWlWindow * window) window->display, &info); gwlbuf = gst_buffer_add_wl_buffer (buf, wlbuf, window->display); gst_wl_buffer_attach (gwlbuf, window->area_surface_wrapper); - wl_surface_damage (window->area_surface_wrapper, 0, 0, G_MAXINT32, + wl_surface_damage_buffer (window->area_surface_wrapper, 0, 0, G_MAXINT32, G_MAXINT32); /* at this point, the GstWlBuffer keeps the buffer -- 2.7.4