[gtk+] Exit remove_child_area when region is empty



commit aa47fca68f9e71e49677d90e0e93578d4db3ac96
Author: Alexander Larsson <alexl redhat com>
Date:   Sun Jul 19 22:36:43 2009 +0200

    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 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index a1fa450..3746a8f 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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]