macos: reduce chances for layout cycles
authorChristian Hergert <christian@hergert.me>
Wed, 2 Mar 2022 08:40:21 +0000 (00:40 -0800)
committerChristian Hergert <chergert@redhat.com>
Wed, 16 Mar 2022 19:25:09 +0000 (12:25 -0700)
We need to be more careful about when we request a layout because it can
cause us to get into a layout cycle at maximum frame rate.

gdk/macos/gdkmacossurface.c

index 14cb3de0150164cd6548aa9b9780e0201868a6ab..385775fe58c5322d6d79c3cdeabb74ffd2c81547 100644 (file)
@@ -158,9 +158,6 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
       if (GDK_IS_MACOS_POPUP_SURFACE (child))
         _gdk_macos_popup_surface_reposition (GDK_MACOS_POPUP_SURFACE (child));
     }
-
-  if (GDK_IS_POPUP (self) && self->did_initial_present)
-    gdk_surface_request_layout (GDK_SURFACE (self));
 }
 
 static void
@@ -851,7 +848,6 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
       g_clear_object (&self->front);
 
       _gdk_surface_update_size (surface);
-      gdk_surface_request_layout (surface);
       gdk_surface_invalidate_rect (surface, NULL);
     }
 
@@ -1110,7 +1106,6 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
   gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
 
   self->in_change_monitor = FALSE;
-  _gdk_macos_surface_request_frame (self);
 }
 
 GdkMonitor *