X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72a1118475822244357d487fc937c15331654148..34a336adb6796a596e3d59846bd23370f936921f:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 7246affec8..3c80ac8f54 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -139,9 +139,6 @@ void wxTopLevelWindowMSW::Init() m_iconized = m_maximizeOnShow = FALSE; - // unlike (almost?) all other windows, frames are created hidden - m_isShown = FALSE; - // Data to save/restore when calling ShowFullScreen m_fsStyle = 0; m_fsOldWindowStyle = 0; @@ -394,6 +391,15 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, int x, y, w, h; (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h); + if ( x == (int)CW_USEDEFAULT ) + { + // centre it on the screen - what else can we do? + wxSize sizeDpy = wxGetDisplaySize(); + + x = (sizeDpy.x - w) / 2; + y = (sizeDpy.y - h) / 2; + } + if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) { wxLogLastError(wxT("MoveWindow"));