From aa47fca68f9e71e49677d90e0e93578d4db3ac96 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Sun, 19 Jul 2009 22:36:43 +0200 Subject: [PATCH] Exit remove_child_area when region is empty When the region is empty we can return early, because there is no more area to remove. This happens often for children of scrolled windows (i.e. things that are clipped out. --- gdk/gdkwindow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index a1fa4505df..3746a8f953 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -623,6 +623,11 @@ remove_child_area (GdkWindowObject *private, if (child == until) break; + /* If region is empty already, no need to do + anything potentially costly */ + if (gdk_region_empty (region)) + break; + if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only || child->composited) continue;