From 2a999d418b85d8ac3b96cb5c699fd0c9ec1416b8 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 2 Nov 2017 18:03:38 +0900 Subject: [PATCH] fix caret position --- win32ss/user/ntuser/caret.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/win32ss/user/ntuser/caret.c b/win32ss/user/ntuser/caret.c index a7549e752d..9ab590c0b8 100644 --- a/win32ss/user/ntuser/caret.c +++ b/win32ss/user/ntuser/caret.c @@ -3,7 +3,8 @@ * PROJECT: ReactOS Win32k subsystem * PURPOSE: Caret functions * FILE: win32ss/user/ntuser/caret.c - * PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) + * PROGRAMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net) + * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) */ #include @@ -21,6 +22,7 @@ co_IntDrawCaret(PWND pWnd, PTHRDCARETINFO CaretInfo) { HDC hdc, hdcMem; HBITMAP hbmOld; + RECT rcClient; BOOL bDone = FALSE; if (pWnd == NULL) @@ -29,7 +31,7 @@ co_IntDrawCaret(PWND pWnd, PTHRDCARETINFO CaretInfo) return; } - hdc = UserGetDCEx(pWnd, 0, DCX_USESTYLE | DCX_WINDOW); + hdc = UserGetDCEx(pWnd, NULL, DCX_USESTYLE); if (!hdc) { ERR("GetDC failed\n"); @@ -41,6 +43,13 @@ co_IntDrawCaret(PWND pWnd, PTHRDCARETINFO CaretInfo) NtGdiSaveDC(hdc); } + IntGetClientRect(pWnd, &rcClient); + NtGdiIntersectClipRect(hdc, + rcClient.left, + rcClient.top, + rcClient.right, + rcClient.bottom); + if (CaretInfo->Bitmap) { if (!GreGetBitmapDimension(CaretInfo->Bitmap, &CaretInfo->Size)) -- 2.14.2