wayland: Reset pending offset in GL path
authorIvan Molodetskikh <yalterz@gmail.com>
Wed, 15 Mar 2023 23:11:40 +0000 (16:11 -0700)
committerIvan Molodetskikh <yalterz@gmail.com>
Thu, 16 Mar 2023 17:54:15 +0000 (10:54 -0700)
Otherwise GL surfaces that redraw without changing the hotspot have it
applied on top every frame and quickly slide away.

The cairo path and the X11 backend do not have this bug.

gdk/wayland/gdkglcontext-wayland.c

index 7becec5ed56df3e6ac5c914880ab6352220371c4..b0ae79a0b72824c84765759f5b1efd68a1467340 100644 (file)
@@ -65,6 +65,9 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
   int dx = impl->pending_buffer_offset_x;
   int dy = impl->pending_buffer_offset_y;
 
+  impl->pending_buffer_offset_x = 0;
+  impl->pending_buffer_offset_y = 0;
+
   gdk_wayland_surface_sync (surface);
   gdk_wayland_surface_request_frame (surface);
 
@@ -118,7 +121,7 @@ gdk_wayland_display_init_gl (GdkDisplay  *display,
 {
   GdkWaylandDisplay *self = GDK_WAYLAND_DISPLAY (display);
 
-  if (!gdk_display_init_egl (display, 
+  if (!gdk_display_init_egl (display,
                              EGL_PLATFORM_WAYLAND_EXT,
                              self->wl_display,
                              TRUE,