]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't un-maximize the window when Iconize(false) is called in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Aug 2011 19:46:44 +0000 (19:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Aug 2011 19:46:44 +0000 (19:46 +0000)
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

src/msw/toplevel.cpp

index 5b271f01a2699e5bdec3100a0945f4c47d3158cb..45ef33843b35da278e3e9690163fe512691aab36 100644 (file)
@@ -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