From a1cb57f549bcef4fcfec045eed5b91dd104c16bc Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 30 Mar 2014 01:52:11 +0000 Subject: [PATCH] adjust size hints when decor size changes, to prevent changing a set client size during initial show closes #15794 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 62cc9316b1..1931966de7 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1262,6 +1262,15 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const DecorSize& decorSize) if (m_minWidth > 0 || m_minHeight > 0 || m_maxWidth > 0 || m_maxHeight > 0) { // update size hints, they depend on m_decorSize + if (!m_deferShow) + { + // if size hints match old size, assume hints were set to + // maintain current client size, and adjust hints accordingly + if (m_minWidth == m_height) m_minWidth += diff.x; + if (m_maxWidth == m_height) m_maxWidth += diff.x; + if (m_minHeight == m_height) m_minHeight += diff.y; + if (m_maxHeight == m_height) m_maxHeight += diff.y; + } DoSetSizeHints(m_minWidth, m_minHeight, m_maxWidth, m_maxHeight, m_incWidth, m_incHeight); } if (m_deferShow)