From e8440ff58cd60fe6e51a380219eeccb056b68361 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 23 Jun 2012 03:33:08 +0000 Subject: [PATCH] properly handle stupidly small maximum size hints git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index bdc7e2a392..323e1a00b3 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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; - if (maxSize.x > m_decorSize.x) + if (maxSize.x > 0) + { 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; + if (hints.max_height < hints.min_height) + hints.max_height = hints.min_height; + } if (incW > 0 || incH > 0) { hints_mask |= GDK_HINT_RESIZE_INC; -- 2.45.2