Send wxEVT_DESTROY to children of wxAuiManager-associated window

This fixes a regression introduced in f646532889 (Call
wxAuiManager::UnInit() if associated frame is destroyed, 2020-07-18)
since when children of a window managed by wxAuiManager didn't receive
wxEVT_DESTROY any more because the manager intercepted it for its own
needs.

Closes #18938.
This commit is contained in:
Vadim Zeitlin
2020-10-15 23:53:12 +02:00
parent a1381347c9
commit 1fb8d3621f

View File

@@ -3961,7 +3961,23 @@ void wxAuiManager::Repaint(wxDC* dc)
void wxAuiManager::OnDestroy(wxWindowDestroyEvent& event)
{
if ( event.GetEventObject() == m_frame )
{
wxWindow* const frame = m_frame;
UnInit();
// Just calling Skip() would be insufficient in this case, as by
// removing the event handler from the event handlers chain in UnInit()
// we'd still prevent the frame from getting this event, so we need to
// forward it to it manually. Note that this must be done after calling
// UnInit() to prevent infinite recursion.
if ( frame )
frame->ProcessWindowEventLocally(event);
}
else
{
event.Skip();
}
}
void wxAuiManager::OnPaint(wxPaintEvent& WXUNUSED(event))