diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index bdd66f2f8b..f93075d2a0 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1511,12 +1511,20 @@ gtk_popover_measure (GtkWidget *widget, GtkCssStyle *style; GtkBorder shadow_width; - if (for_size >= 0 && (POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL))) - for_size -= tail_height; - style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (priv->contents_widget))); gtk_css_shadow_value_get_extents (style->used->box_shadow, &shadow_width); + if (for_size >= 0) + { + if ((POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL))) + for_size -= tail_height; + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + for_size -= shadow_width.top + shadow_width.bottom; + else + for_size -= shadow_width.left + shadow_width.right; + } + gtk_widget_measure (priv->contents_widget, orientation, for_size, minimum, natural,