popover: Allocate after setting final_position

When we find out that we've been flipped, set
final_position and final_rect before allocating
the popover. This prevents 'smashed-in beak' disease.

Fixes: #2671
This commit is contained in:
Matthias Clasen 2020-04-27 20:58:03 -04:00
parent 12adf6362f
commit 473709fee3

View File

@ -379,11 +379,6 @@ update_popover_layout (GtkPopover *popover,
did_flip_vertically (gdk_popup_layout_get_surface_anchor (layout),
gdk_popup_get_surface_anchor (popup));
gtk_widget_allocate (GTK_WIDGET (popover),
gdk_surface_get_width (priv->surface),
gdk_surface_get_height (priv->surface),
-1, NULL);
priv->final_rect = final_rect;
switch (priv->position)
@ -405,6 +400,11 @@ update_popover_layout (GtkPopover *popover,
break;
}
gtk_widget_allocate (GTK_WIDGET (popover),
gdk_surface_get_width (priv->surface),
gdk_surface_get_height (priv->surface),
-1, NULL);
g_clear_pointer (&priv->arrow_render_node, gsk_render_node_unref);
gtk_widget_queue_draw (GTK_WIDGET (popover));
}