[gtk/wip/chergert/macos-fixes: 8/9] macos: be more defensive about freezing updates




commit 0e4c595b510be0c3d4431c6524622464254e9d4d
Author: Christian Hergert <christian hergert me>
Date:   Sat Jan 29 17:07:02 2022 -0800

    macos: be more defensive about freezing updates
    
    We only need to freeze the updates if we weren't in the queue already.
    That should be the case, but just better to be defensive here.

 gdk/macos/gdkmacosdisplay.c | 2 ++
 gdk/macos/gdkmacossurface.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index 9507d65c88..5866e03b5e 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -993,6 +993,8 @@ _gdk_macos_display_add_frame_callback (GdkMacosDisplay *self,
        */
       g_queue_push_head_link (&self->awaiting_frames, &surface->frame);
 
+      gdk_surface_freeze_updates (GDK_SURFACE (surface));
+
       if (self->awaiting_frames.length == 1)
         gdk_display_link_source_unpause ((GdkDisplayLinkSource *)self->frame_source);
     }
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 95bb990971..a6a354cab7 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -197,8 +197,6 @@ gdk_macos_surface_end_frame (GdkMacosSurface *self)
     self->pending_frame_counter = timings->frame_counter;
 
   _gdk_macos_display_add_frame_callback (GDK_MACOS_DISPLAY (display), self);
-
-  gdk_surface_freeze_updates (GDK_SURFACE (self));
 }
 
 static void


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