macos: fix positioning of popover tails
authorChristian Hergert <christian@hergert.me>
Fri, 25 Feb 2022 00:29:53 +0000 (16:29 -0800)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 25 Feb 2022 15:51:19 +0000 (10:51 -0500)
This broke with the previous fixes for initial window positioning. We need
the initial positioning so that tails will be displayed correctly when the
popover surface is displayed.

gdk/macos/gdkmacossurface.c

index 0f9fd4d83335ed441b361acb930267c34f5b1954..5998c4162f6aae8eff7ffec8096fc07b1ede87ac 100644 (file)
@@ -69,10 +69,8 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
 {
   g_assert (GDK_IS_MACOS_SURFACE (self));
 
-  if (GDK_SURFACE_DESTROYED (self))
-    return;
 
-  if (!gdk_surface_get_mapped (GDK_SURFACE (self)))
+  if (GDK_SURFACE_DESTROYED (self))
     return;
 
   for (const GList *iter = GDK_SURFACE (self)->children;
@@ -767,18 +765,15 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
                                           content_rect.origin.y + content_rect.size.height,
                                           &self->root_x, &self->root_y);
 
-  if (self->did_initial_present)
+  if (surface->parent != NULL)
     {
-      if (surface->parent != NULL)
-        {
-          surface->x = self->root_x - GDK_MACOS_SURFACE (surface->parent)->root_x;
-          surface->y = self->root_y - GDK_MACOS_SURFACE (surface->parent)->root_y;
-        }
-      else
-        {
-          surface->x = self->root_x;
-          surface->y = self->root_y;
-        }
+      surface->x = self->root_x - GDK_MACOS_SURFACE (surface->parent)->root_x;
+      surface->y = self->root_y - GDK_MACOS_SURFACE (surface->parent)->root_y;
+    }
+  else
+    {
+      surface->x = self->root_x;
+      surface->y = self->root_y;
     }
 
   if (surface->width != content_rect.size.width ||