[gtk+/client-side-decorations: 20/50] check for -1 before setting



commit bc8cb25f24cbac48378f52c9a688d278c9a0cd6a
Author: Cody Russell <crussell canonical com>
Date:   Thu May 21 12:02:17 2009 +0200

    check for -1 before setting

 gtk/gtkwindow.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 599d731..e70fb3a 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6791,9 +6791,10 @@ paint_decorated_window (GtkStyle *style,
   cairo_t *cr;
   const int hmargin = 2, vmargin = 2, radius = 5;
 
-  // XXX - why are width,height coming in at -1,-1?
-  width = widget->allocation.width;
-  height = widget->allocation.height;
+  if (width == -1)
+    width = widget->allocation.width;
+  if (height == -1)
+    height = widget->allocation.height;
 
   cr = gdk_cairo_create (window);
   cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);



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