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



commit a741c53d2315aeb9bb827cfd8a45fdfaf694ba46
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 dfdaad5..b165e88 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6846,9 +6846,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]