X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/304435501bf40f2311e3df9f350a32a6ea142ddd..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 87a4f12601..53d7313f36 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -716,6 +716,16 @@ bool wxWindowMSW::Show(bool show) ::ShowWindow(hWnd, show ? SW_SHOW : SW_HIDE); } + if ( IsFrozen() ) + { + // DoFreeze/DoThaw don't do anything if the window is not shown, so + // we have to call them from here now + if ( show ) + DoFreeze(); + else + DoThaw(); + } + return true; } @@ -1615,20 +1625,22 @@ static inline void SendSetRedraw(HWND hwnd, bool on) void wxWindowMSW::DoFreeze() { - if ( IsShown() ) - SendSetRedraw(GetHwnd(), false); + if ( !IsShown() ) + return; // no point in freezing hidden window + + SendSetRedraw(GetHwnd(), false); } void wxWindowMSW::DoThaw() { - if ( IsShown() ) - { - SendSetRedraw(GetHwnd(), true); + if ( !IsShown() ) + return; // hidden windows aren't frozen by DoFreeze - // we need to refresh everything or otherwise the invalidated area - // is not going to be repainted - Refresh(); - } + SendSetRedraw(GetHwnd(), true); + + // we need to refresh everything or otherwise the invalidated area + // is not going to be repainted + Refresh(); } void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)