]> git.saurik.com Git - wxWidgets.git/commitdiff
properly handle stupidly small maximum size hints
authorPaul Cornett <paulcor@bullseye.com>
Sat, 23 Jun 2012 03:33:08 +0000 (03:33 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sat, 23 Jun 2012 03:33:08 +0000 (03:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/toplevel.cpp

index bdc7e2a39255d8bf75e87affbb0d691adc275310..323e1a00b3c8f90d2eb9918d64f77a016cf2570e 100644 (file)
@@ -1115,10 +1115,18 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
         hints.min_width = minSize.x - m_decorSize.x;
     if (minSize.y > m_decorSize.y)
         hints.min_height = minSize.y - m_decorSize.y;
         hints.min_width = minSize.x - m_decorSize.x;
     if (minSize.y > m_decorSize.y)
         hints.min_height = minSize.y - m_decorSize.y;
-    if (maxSize.x > m_decorSize.x)
+    if (maxSize.x > 0)
+    {
         hints.max_width = maxSize.x - m_decorSize.x;
         hints.max_width = maxSize.x - m_decorSize.x;
-    if (maxSize.y > m_decorSize.y)
+        if (hints.max_width < hints.min_width)
+            hints.max_width = hints.min_width;
+    }
+    if (maxSize.y > 0)
+    {
         hints.max_height = maxSize.y - m_decorSize.y;
         hints.max_height = maxSize.y - m_decorSize.y;
+        if (hints.max_height < hints.min_height)
+            hints.max_height = hints.min_height;
+    }
     if (incW > 0 || incH > 0)
     {
         hints_mask |= GDK_HINT_RESIZE_INC;
     if (incW > 0 || incH > 0)
     {
         hints_mask |= GDK_HINT_RESIZE_INC;