Don't change client size of TLW when centering it in wxGTK.

Setting the frame client size and then calling Centre() on it resulted in the
frame coming up with a wrong client size in wxGTK because the call to Centre()
resulted in calling wxTopLevelWindow::DoSetSize() which unconditionally reset
m_deferShowAllowed to true, undoing setting it to false in DoSetClientSize().

Only reset m_deferShowAllowed if the size was really changed but not if the
window was only moved, as happens when centering it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-07-23 15:02:53 +00:00
parent 8bd6a7a05c
commit eef432913f

View File

@@ -1022,8 +1022,6 @@ 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;
@@ -1057,6 +1055,8 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
if (m_height < 1) m_height = 1;
if (m_width != oldSize.x || m_height != oldSize.y)
{
m_deferShowAllowed = true;
int w, h;
GTKDoGetSize(&w, &h);
gtk_window_resize(GTK_WINDOW(m_widget), w, h);