[gtk/matthiasc/surface-state-rework: 30/80] gdk/surface: Try to reschedule pending phase until dispatched




commit 871a42ab673f4f0e8e4b7293b82abbec1a60c37a
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Dec 2 09:39:48 2020 +0100

    gdk/surface: Try to reschedule pending phase until dispatched
    
    If a surface scheduled a relayout, got frozen, and a layout phase
    happened, then got unfrozen, it wouldn't see it's layout being
    requested; avoid this race by remembering the pending phases until they
    actually happened.

 gdk/gdksurface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index a8f93170ec..d0cdcc33f2 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1368,6 +1368,8 @@ gdk_surface_layout_on_clock (GdkFrameClock *clock,
   if (surface->update_freeze_count)
     return;
 
+  surface->pending_phases &= ~GDK_FRAME_CLOCK_PHASE_LAYOUT;
+
   class = GDK_SURFACE_GET_CLASS (surface);
   if (class->compute_size)
     class->compute_size (surface);
@@ -1420,6 +1422,7 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock,
        * do the update later when idle instead. */
       !surface->in_update)
     {
+      surface->pending_phases &= ~GDK_FRAME_CLOCK_PHASE_PAINT;
       gdk_surface_process_updates_internal (surface);
       gdk_surface_remove_update_surface (surface);
     }
@@ -1602,10 +1605,7 @@ gdk_surface_thaw_updates (GdkSurface *surface)
       _gdk_frame_clock_inhibit_freeze (frame_clock);
 
       if (surface->pending_phases)
-        {
-          gdk_frame_clock_request_phase (frame_clock, surface->pending_phases);
-          surface->pending_phases = 0;
-        }
+        gdk_frame_clock_request_phase (frame_clock, surface->pending_phases);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]