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
This commit is contained in:
Matthias Clasen 2024-08-31 07:13:07 -04:00
parent da9886d822
commit bbfd8e0e89

View File

@ -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);