From: Vadim Zeitlin Date: Mon, 23 Jul 2012 15:02:53 +0000 (+0000) Subject: Don't change client size of TLW when centering it in wxGTK. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/eef432913f750a7467cd71b27c1fbfd34a61f256 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 --- diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 4027023d7c..1bcc3ce8e9 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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);