[gtk/wip/chergert/quartz4u: 105/146] macos: cleanup repositioning a bit



commit ab1fcd684857ce76f042416135e242474cf0e1f0
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 20 17:30:54 2020 -0700

    macos: cleanup repositioning a bit
    
    Still have an issue though on show/hide/show tails

 gdk/macos/GdkMacosWindow.c  | 3 +++
 gdk/macos/gdkmacossurface.c | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index 1d351214d7..029af5025d 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -199,6 +199,7 @@
     gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MAXIMIZED, 0);
 
   _gdk_macos_surface_update_position (gdk_surface);
+  _gdk_macos_surface_reposition_children (gdk_surface);
 
   [self checkSendEnterNotify];
 }
@@ -242,6 +243,8 @@
   _gdk_windowing_got_event (display, node, event,
                             _gdk_display_get_next_serial (display));
 
+  _gdk_macos_surface_reposition_children (gdk_surface);
+
   [self checkSendEnterNotify];
 }
 
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 52f0e6b096..6815e64934 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -62,6 +62,9 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
 {
   g_assert (GDK_IS_MACOS_SURFACE (self));
 
+  if (!gdk_surface_get_mapped (GDK_SURFACE (self)))
+    return;
+
   for (const GList *iter = GDK_SURFACE (self)->children;
        iter != NULL;
        iter = iter->next)
@@ -73,6 +76,9 @@ _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)
+    g_signal_emit_by_name (self, "popup-layout-changed");
 }
 
 static void
@@ -640,8 +646,6 @@ _gdk_macos_surface_update_position (GdkMacosSurface *self)
       surface->x = self->root_x;
       surface->y = self->root_y;
     }
-
-  _gdk_macos_surface_reposition_children (self);
 }
 
 void


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