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 <paulcor@users.noreply.github.com>
This commit is contained in:
Vadim Zeitlin
2021-04-12 21:27:32 +02:00
parent b5a78fbac6
commit 2e16418707

View File

@@ -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__