X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73c902d669217bf89cf1e1105622c63cbfe3befb..0c83d5ef4b078905e1a1d21366101d9cd0ed8735:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index e1ac910f09..e861e661ef 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -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 }