Fix regression in wxTopLevelWindowMSW::IsMaximized()

This fixes another bug from 3518f1a7d8
(after the one fixed in 5766280311): if a
window was maximized by user and then hidden, its IsMaximized() returned
false because it examined m_showCmd which didn't have SW_MAXIMIZE value
in this case.

The same was true for IsMinimised() as well.

Fix both problems by updating the value of m_showCmd when hiding the
window.
This commit is contained in:
Vadim Zeitlin
2018-10-26 04:01:04 +02:00
parent f11849b7e8
commit 965f890919

View File

@@ -579,6 +579,15 @@ bool wxTopLevelWindowMSW::Show(bool show)
}
else // hide
{
// When hiding the window, remember if it was maximized or iconized in
// order to return the correct value from Is{Maximized,Iconized}().
if ( ::IsZoomed(GetHwnd()) )
m_showCmd = SW_MAXIMIZE;
else if ( ::IsIconic(GetHwnd()) )
m_showCmd = SW_MINIMIZE;
else
m_showCmd = SW_SHOW;
nShowCmd = SW_HIDE;
}