From 7505b72ead138a4c33c67479bc0db51500b63576 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 26 Jan 2009 11:48:29 +0000 Subject: [PATCH] don't show the currently hidden frame if Iconize() is called (see #10426) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toplevel.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 1739212116..3136e36631 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -653,6 +653,11 @@ bool wxTopLevelWindowMSW::Show(bool show) m_maximizeOnShow = false; } + else if ( m_iconized ) + { + // iconize and show + nShowCmd = SW_MINIMIZE; + } else // just show { // we shouldn't use SW_SHOW which also activates the window for @@ -736,7 +741,17 @@ bool wxTopLevelWindowMSW::IsMaximized() const void wxTopLevelWindowMSW::Iconize(bool iconize) { - DoShowWindow(iconize ? SW_MINIMIZE : SW_RESTORE); + if ( IsShown() ) + { + // change the window state immediately + DoShowWindow(iconize ? SW_MINIMIZE : SW_RESTORE); + } + else // hidden + { + // iconizing the window shouldn't show it so just remember that we need + // to become iconized when shown later + m_iconized = true; + } } bool wxTopLevelWindowMSW::IsIconized() const @@ -744,6 +759,9 @@ bool wxTopLevelWindowMSW::IsIconized() const #ifdef __WXWINCE__ return false; #else + if ( !IsShown() ) + 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, -- 2.45.2