From: Gé van Geldorp Date: Sun, 4 Dec 2005 22:33:18 +0000 (+0000) Subject: Make sure that WM_NCPAINT messages are generated by calling BeginPaint X-Git-Tag: backups/ros-branch-0_2_9@19949~39 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=b3329d6391e1e71ca8fb86036f9554a8d611de05 Make sure that WM_NCPAINT messages are generated by calling BeginPaint svn path=/trunk/; revision=19895 --- diff --git a/reactos/subsys/csrss/win32csr/guiconsole.c b/reactos/subsys/csrss/win32csr/guiconsole.c index 06b89d4af80..8b868a23ecc 100644 --- a/reactos/subsys/csrss/win32csr/guiconsole.c +++ b/reactos/subsys/csrss/win32csr/guiconsole.c @@ -360,65 +360,56 @@ GuiConsolePaint(PCSRSS_CONSOLE Console, static VOID FASTCALL GuiConsoleHandlePaint(HWND hWnd, HDC hDCPaint) { - RECT rcUpdate; HDC hDC; PAINTSTRUCT ps; PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; - if (GetUpdateRect(hWnd, - &rcUpdate, - FALSE)) + hDC = BeginPaint(hWnd, &ps); + if (hDC != NULL && + ps.rcPaint.left < ps.rcPaint.right && + ps.rcPaint.top < ps.rcPaint.bottom) { - hDC = (hDCPaint != NULL ? hDCPaint : BeginPaint(hWnd, - &ps)); - if (hDC != NULL) + GuiConsoleGetDataPointers(hWnd, + &Console, + &GuiData); + if (Console != NULL && GuiData != NULL && + Console->ActiveBuffer != NULL) { - GuiConsoleGetDataPointers(hWnd, - &Console, - &GuiData); - if (Console != NULL && GuiData != NULL && - Console->ActiveBuffer != NULL) + EnterCriticalSection(&GuiData->Lock); + + GuiConsolePaint(Console, + GuiData, + hDC, + &ps.rcPaint); + + if (GuiData->Selection.left != -1) { - EnterCriticalSection(&GuiData->Lock); + RECT rc = GuiData->Selection; - GuiConsolePaint(Console, - GuiData, - hDC, - &rcUpdate); + rc.left *= GuiData->CharWidth; + rc.top *= GuiData->CharHeight; + rc.right *= GuiData->CharWidth; + rc.bottom *= GuiData->CharHeight; - if (GuiData->Selection.left != -1) + /* invert the selection */ + if (IntersectRect(&rc, + &ps.rcPaint, + &rc)) { - RECT rc = GuiData->Selection; - - rc.left *= GuiData->CharWidth; - rc.top *= GuiData->CharHeight; - rc.right *= GuiData->CharWidth; - rc.bottom *= GuiData->CharHeight; - - /* invert the selection */ - if (IntersectRect(&rc, - &rcUpdate, - &rc)) - { - PatBlt(hDC, - rc.left, - rc.top, - rc.right - rc.left, - rc.bottom - rc.top, - DSTINVERT); - } + PatBlt(hDC, + rc.left, + rc.top, + rc.right - rc.left, + rc.bottom - rc.top, + DSTINVERT); } - - LeaveCriticalSection(&GuiData->Lock); } - if (hDCPaint == NULL) - { - EndPaint(hWnd, - &ps); - } + LeaveCriticalSection(&GuiData->Lock); } + + EndPaint(hWnd, &ps); } }