From 9121b906e83d3038a772b24de2cbf979b99ff04f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 5 Jul 2018 19:38:21 +0200 Subject: [PATCH] Restore initial wxEVT_SIZE generation for hidden frames in wxMSW Changes of commit cf20a9ced531d502433b5acc25a3bd84505f5fe5 suppressed the generation of the initial wxEVT_SIZE for hidden wxFrames, as the initial WM_SIZE was ignored. This went unnoticed for "normal" frames, which got another WM_SIZE when they were shown in any case, but broke frames with wxFRAME_TOOL_WINDOW style as they're shown using SW_SHOWNA command and in addition to suppressing activation, it also suppresses the generation of WM_SIZE, so such frames didn't get any wxEVT_SIZE at all and appeared without being laid out properly, as could be seen, for example, in the splash sample. Fix this by continuing to generate the size events even for hidden frames, just as we did before, while still skipping all the other stuff which is not necessary for the hidden windows. See https://github.com/wxWidgets/wxWidgets/pull/842 Closes #18161. --- src/msw/frame.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index de176504f0..951b2e447c 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -744,10 +744,11 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg) bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id) { // We can get a WM_SIZE when restoring a hidden window using - // SetWindowPlacement(), don't do anything in this case as our state will - // be really updated later, when (and if) we're shown. + // SetWindowPlacement(), don't do anything here in this case as our state + // will be really updated later, when (and if) we're shown. Still let the + // base class generate wxEVT_SIZE and perform the layout, however. if ( !IsShown() ) - return true; + return false; switch ( id ) {