From 2e1641870785e037abaaea3f12c265dde3ca1dad Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Apr 2021 21:27:32 +0200 Subject: [PATCH] Update TLW client size in wxGTK before sending wxEVT_SHOW If we have to change the client size, it's better to do this before sending the event whose handler might rely on the size being already correct. Co-Authored-By: Paul Cornett --- src/gtk/toplevel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index ec2b6e5b51..999dfa580c 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1545,15 +1545,15 @@ wxTopLevelWindowGTK::DecorSize& wxTopLevelWindowGTK::GetCachedDecorSize() void wxTopLevelWindowGTK::GTKDoAfterShow() { - wxShowEvent showEvent(GetId(), true); - showEvent.SetEventObject(this); - HandleWindowEvent(showEvent); - #ifdef __WXGTK3__ // Set the client size again if necessary, we should be able to do it // correctly by now as the style cache should be up to date. GTKUpdateClientSizeIfNecessary(); #endif // __WXGTK3__ + + wxShowEvent showEvent(GetId(), true); + showEvent.SetEventObject(this); + HandleWindowEvent(showEvent); } #ifdef __WXGTK3__