don't hide the TLW being deleted unless there any other *visible* TLWs remaining (bug 1902632)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -118,15 +118,27 @@ bool wxTopLevelWindowBase::Destroy()
|
|||||||
if ( !wxPendingDelete.Member(this) )
|
if ( !wxPendingDelete.Member(this) )
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
|
|
||||||
if (wxTopLevelWindows.GetCount() > 1)
|
// normally we want to hide the window immediately so that it doesn't get
|
||||||
|
// stuck on the screen while it's being destroyed, however we shouldn't
|
||||||
|
// hide the last visible window as then we might not get any idle events
|
||||||
|
// any more as no events will be sent to the hidden window and without idle
|
||||||
|
// events we won't prune wxPendingDelete list and the application won't
|
||||||
|
// terminate
|
||||||
|
const wxWindowList::const_iterator end = wxTopLevelWindows.end();
|
||||||
|
for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
|
||||||
|
end = wxTopLevelWindows.end();
|
||||||
|
i != end;
|
||||||
|
++i )
|
||||||
{
|
{
|
||||||
// Hide it immediately. This should
|
wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i);
|
||||||
// not be done if this TLW is the
|
if ( win != this && win->IsShown() )
|
||||||
// only one left since we then would
|
{
|
||||||
// risk not to get any idle events
|
// there remains at least one other visible TLW, we can hide this
|
||||||
// at all anymore during which we
|
// one
|
||||||
// could delete any pending events.
|
Hide();
|
||||||
Hide();
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user