[gtk+/client-side-windows: 31/284] Clear to end of window if passing zero width or height to gdk_window_clear_area (fixes clist/ctree c



commit 077eab6edf0df79fd52e43cf7bc893de697c9501
Author: Alexander Larsson <alexl redhat com>
Date:   Sat Dec 6 22:55:09 2008 +0100

    Clear to end of window if passing zero width or height to gdk_window_clear_area (fixes clist/ctree clearing)
---
 gdk/gdkwindow.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 5321ae0..5830f8a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3309,6 +3309,13 @@ gdk_window_clear_area_internal (GdkWindow *window,
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
+  /* This is what XClearArea does, and e.g. GtkCList uses it,
+     so we need to duplicate that */
+  if (width == 0)
+    width = private->width - x;
+  if (height == 0)
+    height = private->height - y;
+  
   if (private->paint_stack)
     gdk_window_clear_backing_rect (window, x, y, width, height);
   else



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