summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-01-20 13:42:45 -0500
committerMatthias Clasen <mclasen@redhat.com>2016-01-20 13:44:34 -0500
commitda31eb4f64eb9218126277851a16f38134fe1f7f (patch)
treef19a5e47963f4dece5aca5296d612b6ced1f7e01
parent51f05a00aef5e54f4ecd006f49ed9d1d0497aae8 (diff)
downloadgtk+-da31eb4f64eb9218126277851a16f38134fe1f7f.tar.gz
container: Don't create too-large clips
gdk_rectangle_union will happily add all the worlds pixels to the union if the initial rectangle is initialized to all zeros. Therefore, explicitly check for an empty rectangle before calling it.
-rw-r--r--gtk/gtkcontainer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 86501d7040..090b4d7100 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -3686,8 +3686,9 @@ gtk_container_should_propagate_draw (GtkContainer *container,
static void
union_with_clip (GtkWidget *widget,
- gpointer clip)
+ gpointer data)
{
+ GdkRectangle *clip = data;
GtkAllocation widget_clip;
if (!gtk_widget_is_visible (widget) ||
@@ -3696,7 +3697,10 @@ union_with_clip (GtkWidget *widget,
gtk_widget_get_clip (widget, &widget_clip);
- gdk_rectangle_union (&widget_clip, clip, clip);
+ if (clip->width == 0 || clip->height == 0)
+ *clip = widget_clip;
+ else
+ gdk_rectangle_union (&widget_clip, clip, clip);
}
void