wayland: Don't assert when requesting another frame
authorBenjamin Otte <otte@redhat.com>
Tue, 9 May 2023 12:41:24 +0000 (14:41 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 9 May 2023 14:29:41 +0000 (16:29 +0200)
When GDK_DEBUG=no-vsync is on, we might have more than one outstanding
frame. Don't assert when that hapens. Just request a frame callback for
the first and skip the others.

gdk/wayland/gdksurface-wayland.c

index 483ccec8a2aa237262af6daac2ecf9d9f70996d1..5663a42d3804e6b625ca3edfc00724c3623a1e62 100644 (file)
@@ -370,7 +370,8 @@ gdk_wayland_surface_request_frame (GdkSurface *surface)
   GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
   GdkFrameClock *clock;
 
-  g_assert (self->frame_callback == NULL);
+  if (self->frame_callback != NULL)
+    return;
 
   clock = gdk_surface_get_frame_clock (surface);