widget: Add brute force method to propagate clip

When a gtk_widget_queue_allocate() on some widget increases the clip,
widget->parent's clip was not updated. This appraoch naively just
unions widget's new clip with widget->parent's clip.

This of course only works if widget and parent share the same GDK
window. In the cases where they don't we can't do anything and need a
better fix.

Fixes label-text-shadow-changes-modify-clip.ui reftest.
This commit is contained in:
Benjamin Otte 2016-03-03 00:35:15 +01:00
parent 05d1437e62
commit 3e06942847

View File

@ -15520,6 +15520,23 @@ gtk_widget_set_clip (GtkWidget *widget,
#endif /* G_ENABLE_DEBUG */
priv->clip = *clip;
while (priv->parent &&
_gtk_widget_get_window (widget) == _gtk_widget_get_window (priv->parent))
{
GtkWidgetPrivate *parent_priv = priv->parent->priv;
GdkRectangle union_rect;
gdk_rectangle_union (&priv->clip,
&parent_priv->clip,
&union_rect);
if (gdk_rectangle_equal (&parent_priv->clip, &union_rect))
break;
parent_priv->clip = union_rect;
priv = parent_priv;
}
}
/*