[gtk+] Warn if a widget requests minimum size > natural size



commit 88a90b8abb8ddea5d069e27dd3cb2b6a3d83d5e5
Author: Havoc Pennington <hp pobox com>
Date:   Sun Sep 5 21:46:22 2010 -0400

    Warn if a widget requests minimum size > natural size
    
    Since this makes no sense and there's no reason we should
    have to check for it elsewhere just in case some widget is
    busted.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628808

 gtk/gtksizerequest.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 02d2e79..77f99c4 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -282,6 +282,12 @@ compute_size_for_orientation (GtkSizeRequest    *request,
 									&min_size, &nat_size);
         }
 
+      if (min_size > nat_size)
+        {
+          g_warning ("%s %p reported min size %d and natural size %d; natural size must be >= min size",
+                     G_OBJECT_TYPE_NAME (request), request, min_size, nat_size);
+        }
+
       /* Support for dangling "size-request" signals and forward derived
        * classes that will not default to a ->get_width() that
        * returns the values in the ->requisition cache.



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