x11: Always request frame updates
authorBenjamin Otte <otte@redhat.com>
Fri, 30 Mar 2018 13:36:54 +0000 (15:36 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 30 Mar 2018 14:50:54 +0000 (16:50 +0200)
This ensures that the frame clock gets updated with correct presentation
times even if nothing was drawn.

This is necessary for benchmarking but would also be relevant for videos
that want to sync to the frame clock but draw frames a lot less.

gdk/x11/gdksurface-x11.c

index 29385afb7ead9a0c9a4b72fbf87ae8cf518ead89..387582f47765df73561f834206eb9f48a9e8a71a 100644 (file)
@@ -406,6 +406,10 @@ gdk_x11_surface_end_frame (GdkSurface *surface)
   clock = gdk_surface_get_frame_clock (surface);
   timings = gdk_frame_clock_get_current_timings (clock);
 
+  /* Make sure we request timing updates even if nothing was damaged.
+   * We want the frame clock to be accurate. */
+  gdk_x11_surface_pre_damage (surface);
+
   impl->toplevel->in_frame = FALSE;
 
   if (impl->toplevel->current_counter_value % 2 == 1)