X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8330166c656fc5374a4f27e112772bfb2f14c7ab..4aaef122cbbd5bbe0e70b824e320458e2329dd13:/src/os2/frame.cpp diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index fb3241fea2..bc13037ef5 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -108,6 +108,7 @@ void wxFrame::Init() m_nFsStatusBarHeight = 0; m_nFsToolBarHeight = 0; m_bFsIsMaximized = FALSE; + m_bWasMinimized = FALSE; m_bFsIsShowing = FALSE; m_bIsShown = FALSE; m_pWinLastFocused = (wxWindow *)NULL; @@ -1328,10 +1329,30 @@ void wxFrame::IconizeChildFrames( pNode = pNode->GetNext() ) { wxWindow* pWin = pNode->GetData(); + wxFrame* pFrame = wxDynamicCast(pWin, wxFrame); - if (pWin->IsKindOf(CLASSINFO(wxFrame)) ) + if ( pFrame +#if wxUSE_MDI_ARCHITECTURE + && !wxDynamicCast(pFrame, wxMDIChildFrame) +#endif // wxUSE_MDI_ARCHITECTURE + ) { - ((wxFrame *)pWin)->Iconize(bIconize); + // + // We don't want to restore the child frames which had been + // iconized even before we were iconized, so save the child frame + // status when iconizing the parent frame and check it when + // restoring it. + // + if (bIconize) + { + pFrame->m_bWasMinimized = pFrame->IsIconized(); + } + + // + // This test works for both iconizing and restoring + // + if (!pFrame->m_bWasMinimized) + pFrame->Iconize(bIconize); } } } // end of wxFrame::IconizeChildFrames