diff --git a/include/wx/compositewin.h b/include/wx/compositewin.h index 9a3536854a..a58d2e7e6c 100644 --- a/include/wx/compositewin.h +++ b/include/wx/compositewin.h @@ -102,7 +102,14 @@ public: // The child layout almost invariably depends on the layout direction, // so redo it when it changes. - this->SetSize(-1, -1, -1, -1, wxSIZE_AUTO | wxSIZE_FORCE); + // + // However avoid doing it when we're called from wxWindow::Create() in + // wxGTK as the derived window is not fully created yet and calling its + // SetSize() may be unexpected. This does mean that any future calls to + // SetLayoutDirection(wxLayout_Default) wouldn't result in a re-layout + // neither, but then we're not supposed to be called with it at all. + if ( dir != wxLayout_Default ) + this->SetSize(-1, -1, -1, -1, wxSIZE_AUTO | wxSIZE_FORCE); } #if wxUSE_TOOLTIPS