From: Paul Cornett Date: Tue, 17 Feb 2009 03:32:40 +0000 (+0000) Subject: fix deferred show when SetSize() is called after SetClientSize() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6089c4c8e8f9a6b177c57fae83bd0ffe48045177?hp=6fd068fcf15cd07a1dfb0c675d0a0a29aab019af fix deferred show when SetSize() is called after SetClientSize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 1670cff486..a953b7412e 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -148,6 +148,7 @@ private: bool m_grabbed; bool m_updateDecorSize; + bool m_deferShowAllowed; }; #endif // _WX_GTK_TOPLEVEL_H_ diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index f17d3e2257..5d04f3bcb3 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -442,6 +442,7 @@ void wxTopLevelWindowGTK::Init() m_gdkFunc = 0; m_grabbed = false; m_deferShow = true; + m_deferShowAllowed = true; m_updateDecorSize = true; m_urgency_hint = -2; @@ -780,7 +781,7 @@ bool wxTopLevelWindowGTK::Show( bool show ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - bool deferShow = show && !m_isShown && m_deferShow; + bool deferShow = show && !m_isShown && m_deferShow && m_deferShowAllowed; if (deferShow) { deferShow = false; @@ -896,6 +897,8 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si { wxCHECK_RET( m_widget, wxT("invalid frame") ); + m_deferShowAllowed = true; + // deal with the position first int old_x = m_x; int old_y = m_y; @@ -940,9 +943,9 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si void wxTopLevelWindowGTK::DoSetClientSize(int width, int height) { - if (m_deferShow && !m_isShown) - // Since client size is being explicitly set, don't change it later - m_deferShow = false; + // Since client size is being explicitly set, don't change it later + m_deferShowAllowed = false; + wxTopLevelWindowBase::DoSetClientSize(width, height); }