macos: only emit popup-layout-changed after initial present

Otherwise we risk being re-entrant where GtkPopover will not have a
GdkPopupLayout causing other issues.
This commit is contained in:
Christian Hergert 2020-10-14 16:26:52 -07:00
parent e089bba4f5
commit 0af3d21573
2 changed files with 3 additions and 3 deletions

View File

@ -121,8 +121,6 @@ gdk_macos_popup_surface_present (GdkPopup *popup,
gdk_macos_popup_surface_layout (self, width, height, layout);
GDK_MACOS_SURFACE (self)->did_initial_present = TRUE;
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self)))
return TRUE;
@ -144,6 +142,8 @@ gdk_macos_popup_surface_present (GdkPopup *popup,
show_popup (GDK_MACOS_POPUP_SURFACE (self));
}
GDK_MACOS_SURFACE (self)->did_initial_present = TRUE;
return GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self));
}

View File

@ -84,7 +84,7 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
_gdk_macos_popup_surface_reposition (GDK_MACOS_POPUP_SURFACE (child));
}
if (GDK_IS_POPUP (self))
if (GDK_IS_POPUP (self) && self->did_initial_present)
g_signal_emit_by_name (self, "popup-layout-changed");
}