X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7889b795caf13864867b5d4a4148e1003a1e6953..4ff53d1b7a714df97b2b4e584c67c69037fc47b8:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 9d742a864b..e861e661ef 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -705,8 +705,8 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) } else // hidden { - // we can't maximize the hidden frame because it shows it as well, so - // just remember that we should do it later in this case + // we can't maximize the hidden frame because it shows it as well, + // so just remember that we should do it later in this case m_maximizeOnShow = maximize; // after calling Maximize() the client code expects to get the frame @@ -715,7 +715,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) // it's shown, so return our size as it will be then in this case if ( maximize ) { - // unfortunatrly we don't know which display we're on yet so we + // unfortunately we don't know which display we're on yet so we // have to use the default one SetSize(wxGetClientDisplayRect().GetSize()); } @@ -742,10 +742,11 @@ bool wxTopLevelWindowMSW::IsIconized() const #ifdef __WXWINCE__ return false; #else - // also update the current state - ((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0; - - return m_iconized; + // don't use m_iconized, it may be briefly out of sync with the real state + // as it's only modified when we receive a WM_SIZE and we could be called + // from an event handler from one of the messages we receive before it, + // such as WM_MOVE + return ::IsIconic(GetHwnd()) != 0; #endif }