X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00f7f5a71f431998aa13fa613c89dbcf60b56c28..7e38638c3499c679f25ec0029931aad8e62e70d3:/src/msw/toplevel.cpp?ds=sidebyside diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index d0e47ea963..f87a982735 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -507,9 +507,6 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, { bool ret wxDUMMY_INITIALIZE(false); - // init our fields - Init(); - wxSize sizeReal = size; if ( !sizeReal.IsFullySpecified() ) { @@ -1178,49 +1175,14 @@ bool wxTopLevelWindowMSW::CanSetTransparent() void wxTopLevelWindowMSW::DoFreeze() { - if ( IsShown() ) - { - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *child = node->GetData(); - if ( child->IsTopLevel() ) - continue; - - child->Freeze(); - } - } + // do nothing: freezing toplevel window causes paint and mouse events + // to go through it any TLWs under it, so the best we can do is to freeze + // all children -- and wxWindowBase::Freeze() does that } void wxTopLevelWindowMSW::DoThaw() { - if ( IsShown() ) - { - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *child = node->GetData(); - if ( child->IsTopLevel() ) - continue; - - child->Thaw(); - } - } -} - - -void wxTopLevelWindowMSW::AddChild(wxWindowBase *child) -{ - // adding a child while frozen will assert when thawn, so freeze it as if - // it had been already present when we were frozen - if ( child && !child->IsTopLevel() && IsFrozen() ) - { - child->Freeze(); - } - - wxTopLevelWindowBase::AddChild(child); + // intentionally empty -- see DoFreeze() } @@ -1236,7 +1198,7 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) { // restore focus to the child which was last focused unless we already // have it - wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd); + wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd); wxWindow *winFocus = FindFocus(); if ( !winFocus || wxGetTopLevelParent(winFocus) != this ) @@ -1269,10 +1231,9 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) } wxLogTrace(_T("focus"), - _T("wxTLW %08x deactivated, last focused: %08x."), - (int) m_hWnd, - (int) (m_winLastFocused ? GetHwndOf(m_winLastFocused) - : NULL)); + _T("wxTLW %p deactivated, last focused: %p."), + m_hWnd, + m_winLastFocused ? GetHwndOf(m_winLastFocused) : NULL); event.Skip(); }