popover: Avoid unnecessary work

If the popover isn't visible, no need to do any extra
'cascade' work. This also helps to avoid running into
trouble during finalization when the parents are already
gone.
This commit is contained in:
Matthias Clasen 2024-09-05 15:27:55 -04:00
parent 3bd609d77c
commit 4c295dc49c

View File

@ -2411,6 +2411,9 @@ gtk_popover_popdown (GtkPopover *popover)
{
g_return_if_fail (GTK_IS_POPOVER (popover));
if (!gtk_widget_get_visible (GTK_WIDGET (popover)))
return;
gtk_widget_set_visible (GTK_WIDGET (popover), FALSE);
cascade_popdown (popover);