X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/44353523d85ba44f62bad4ab7b27a14001d4b1ae..120678ee96cd38c8d10ead6e60135004b8e97f9e:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c332ba35ef..a17b0401d2 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1122,7 +1122,7 @@ void wxWindowMSW::SetWindowStyleFlag(long flags) ::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyleReal); - // we must call SetWindowPos() to flash the cached extended style and + // we must call SetWindowPos() to flush the cached extended style and // also to make the change to wxSTAY_ON_TOP style take effect: just // setting the style simply doesn't work if ( !::SetWindowPos(GetHwnd(), @@ -1297,7 +1297,8 @@ void wxWindowMSW::Freeze() { if ( !m_frozenness++ ) { - SendSetRedraw(GetHwnd(), false); + if ( IsShown() ) + SendSetRedraw(GetHwnd(), false); } } @@ -1307,11 +1308,14 @@ void wxWindowMSW::Thaw() if ( !--m_frozenness ) { - SendSetRedraw(GetHwnd(), true); + if ( IsShown() ) + { + SendSetRedraw(GetHwnd(), true); - // we need to refresh everything or otherwise he invalidated area is not - // repainted - Refresh(); + // we need to refresh everything or otherwise the invalidated area + // is not going to be repainted + Refresh(); + } } } @@ -1320,18 +1324,27 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect) HWND hWnd = GetHwnd(); if ( hWnd ) { + RECT mswRect; + const RECT *pRect; if ( rect ) { - RECT mswRect; mswRect.left = rect->x; mswRect.top = rect->y; mswRect.right = rect->x + rect->width; mswRect.bottom = rect->y + rect->height; - ::InvalidateRect(hWnd, &mswRect, eraseBack); + pRect = &mswRect; } else - ::InvalidateRect(hWnd, NULL, eraseBack); + { + pRect = NULL; + } + + UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN; + if ( eraseBack ) + flags |= RDW_ERASE; + + ::RedrawWindow(hWnd, pRect, NULL, flags); } } @@ -1507,12 +1520,12 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height) // if our parent had prepared a defer window handle for us, use it (unless // we are a top level window) wxWindowMSW *parent = GetParent(); - HDWP hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL; + HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL; if ( hdwp ) { hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL, - x, y, width, height, - SWP_NOZORDER); + x, y, width, height, + SWP_NOZORDER); if ( !hdwp ) { wxLogLastError(_T("DeferWindowPos"));