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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user