X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd87d59d57f25d76d6456d2b2895e946a2a75c8f..046d682f0f684977b7ba933a128f5c84e06ded0e:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 78de9b7a43..68136888e9 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -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,31 @@ 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; + } + +#ifndef __SMARTPHONE__ + UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN; + if ( eraseBack ) + flags |= RDW_ERASE; + + ::RedrawWindow(hWnd, pRect, NULL, flags); +#else + ::InvalidateRect(hWnd, pRect, eraseBack); +#endif } } @@ -1504,12 +1521,10 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height) if (height < 0) height = 0; - HDWP hdwp = 0; - // if our parent had prepared a defer window handle for us, use it (unless // we are a top level window) wxWindowMSW *parent = GetParent(); - hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL; + HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL; if ( hdwp ) { hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,