From 3655aa76165c44d8bd5496d71cd7ff6af6314901 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 26 Oct 2007 22:35:54 +0000 Subject: [PATCH] When freezing a top-level window freeze its top children instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 2cee2bc994..aac4b16de1 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1516,7 +1516,29 @@ void wxWindowMSW::Freeze() if ( !m_frozenness++ ) { if ( IsShown() ) - SendSetRedraw(GetHwnd(), false); + { + if ( IsTopLevel() ) + { + // If this is a TLW, then freeze it's non-TLW children + // instead. This is needed because on Windows a frozen TLW + // lets window paint and mouse events pass through to other + // Windows below this one in z-order. + for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); + node; + node = node->GetNext() ) + { + wxWindow *child = node->GetData(); + if ( child->IsTopLevel() ) + continue; + else + child->Freeze(); + } + } + else // This is not a TLW, so just freeze it. + { + SendSetRedraw(GetHwnd(), false); + } + } } } @@ -1528,8 +1550,26 @@ void wxWindowMSW::Thaw() { if ( IsShown() ) { - SendSetRedraw(GetHwnd(), true); - + if ( IsTopLevel() ) + { + // If this is a TLW, then Thaw it's non-TLW children + // instead. See Freeze. + for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); + node; + node = node->GetNext() ) + { + wxWindow *child = node->GetData(); + if ( child->IsTopLevel() ) + continue; + else + child->Thaw(); + } + } + else // This is not a TLW, so just thaw it. + { + SendSetRedraw(GetHwnd(), true); + } + // we need to refresh everything or otherwise the invalidated area // is not going to be repainted Refresh();