From bbfd8e0e8925409e38f7ca643bb1f7f4b7cb73fd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 31 Aug 2024 07:13:07 -0400 Subject: [PATCH] vulkan: Use wl_surface_offset Call wl_surface_offset in end_frame to apply the offset for drag surfaces. This matches what the GL draw context already does, and it fixes drag surfaces jumping at the beginning of the drag. Fixes: #6972 --- gdk/wayland/gdkvulkancontext-wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c index ca1db019ef..48a7de3f48 100644 --- a/gdk/wayland/gdkvulkancontext-wayland.c +++ b/gdk/wayland/gdkvulkancontext-wayland.c @@ -64,10 +64,16 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context, cairo_region_t *painted) { GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); + GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); + int dx = impl->pending_buffer_offset_x; + int dy = impl->pending_buffer_offset_y; gdk_wayland_surface_sync (surface); gdk_wayland_surface_request_frame (surface); + if (wl_surface_get_version (impl->display_server.wl_surface) >= WL_SURFACE_OFFSET_SINCE_VERSION) + wl_surface_offset (impl->display_server.wl_surface, dx, dy); + GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted); gdk_wayland_surface_notify_committed (surface);