From: Vadim Zeitlin Date: Tue, 2 Aug 2011 19:46:44 +0000 (+0000) Subject: Don't un-maximize the window when Iconize(false) is called in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/57429bfda5e510aa5df3f4c75936c33b6f174c26 Don't un-maximize the window when Iconize(false) is called in wxMSW. Calling Iconize(false) on a maximized window restored it to its normal state instead of doing nothing as expected. Return immediately from Iconize() if the requested state is already the current one to avoid it. Closes #13373. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 5b271f01a2..45ef33843b 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -737,6 +737,13 @@ bool wxTopLevelWindowMSW::IsMaximized() const void wxTopLevelWindowMSW::Iconize(bool iconize) { + if ( iconize == m_iconized ) + { + // Do nothing, in particular don't restore non-iconized windows when + // Iconize(false) is called as this would wrongly un-maximize them. + return; + } + if ( IsShown() ) { // change the window state immediately