Fix possible crash after 3217a4e8a2

3217a4e8a2 (Fix best size for windows which are hidden when TLW is shown
with GTK3, 2021-04-30) did not account for possibility that window needing
revalidated best size is also the TLW.
See #16088
This commit is contained in:
Paul Cornett
2021-05-03 09:26:35 -07:00
parent 0943beb241
commit a3b7244efe

View File

@@ -5871,17 +5871,20 @@ void wxWindowGTK::GTKSizeRevalidate()
wxWindow* w = win;
while (w && w->IsShown() && !w->IsTopLevel())
w = w->GetParent();
// If win is a child of this
if (w == this)
{
win->InvalidateBestSize();
gs_sizeRevalidateList = g_list_delete_link(gs_sizeRevalidateList, p);
do
// Mark parents as needing size event
m_needSizeEvent = true;
while (win != this)
{
win = win->m_parent;
if (win->m_needSizeEvent)
break;
win->m_needSizeEvent = true;
} while (win != this);
}
}
}
}