From a3b7244efe1b49facd6bf7620b73ca2ebf9ac836 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 3 May 2021 09:26:35 -0700 Subject: [PATCH] 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 --- src/gtk/window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index f44bda99c3..d7b2e964af 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -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); + } } } }