From 593354ca47abaae8a434f99642acc57f7834f77b Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 28 Feb 2008 06:34:43 +0000 Subject: [PATCH] revert updating GTK size hints when window decorations change, it messes up min size set by a sizer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/toplevel.h | 2 -- src/gtk/toplevel.cpp | 21 ++++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index a8bc266b57..2fa607c415 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -145,8 +145,6 @@ private: // is the frame currently grabbed explicitly by the application? bool m_grabbed; - - wxSize m_sizeIncHint; }; #endif // _WX_GTK_TOPLEVEL_H_ diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 35197bcd41..158ff23132 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -939,8 +939,6 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH, int incW, int incH ) { wxTopLevelWindowBase::DoSetSizeHints( minW, minH, maxW, maxH, incW, incH ); - m_sizeIncHint.x = incW; - m_sizeIncHint.y = incH; const wxSize minSize = GetMinSize(); const wxSize maxSize = GetMaxSize(); @@ -982,23 +980,32 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize) { const wxSize diff = decorSize - m_decorSize; m_decorSize = decorSize; - SetSizeHints(GetMinSize(), GetMaxSize(), m_sizeIncHint); + bool resized = false; if (m_deferShow) { // keep overall size unchanged by shrinking m_widget int w, h; GTKDoGetSize(&w, &h); - gtk_window_resize(GTK_WINDOW(m_widget), w, h); + // but not if size would be less than minimum, it won't take effect + const wxSize minSize = GetMinSize(); + if (w >= minSize.x && h >= minSize.y) + { + gtk_window_resize(GTK_WINDOW(m_widget), w, h); + resized = true; + } } - else + if (!resized) { // adjust overall size to match change in frame extents m_width += diff.x; m_height += diff.y; if (m_width < 0) m_width = 0; if (m_height < 0) m_height = 0; - m_oldClientWidth = 0; - gtk_widget_queue_resize(m_wxwindow); + if (!m_deferShow) + { + m_oldClientWidth = 0; + gtk_widget_queue_resize(m_wxwindow); + } } } if (m_deferShow) -- 2.45.2