[NTUSER] Fix caret display mistake (#2180)

Take care of caret visibility. co_IntSetCaretPos function wrongly drawn the caret upon invisible caret. @Doug-Lyons did test this patch. CORE-15661
This commit is contained in:
Katayama Hirofumi MZ 2019-12-26 19:08:01 +09:00 committed by GitHub
parent 3f9e695061
commit 22f883278b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,10 +217,13 @@ co_IntSetCaretPos(int X, int Y)
if(ThreadQueue->CaretInfo.Pos.x != X || ThreadQueue->CaretInfo.Pos.y != Y)
{
co_IntHideCaret(&ThreadQueue->CaretInfo);
ThreadQueue->CaretInfo.Showing = 1;
ThreadQueue->CaretInfo.Pos.x = X;
ThreadQueue->CaretInfo.Pos.y = Y;
co_IntDrawCaret(pWnd, &ThreadQueue->CaretInfo);
if (ThreadQueue->CaretInfo.Visible)
{
ThreadQueue->CaretInfo.Showing = 1;
co_IntDrawCaret(pWnd, &ThreadQueue->CaretInfo);
}
IntSetTimer(pWnd, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM);
IntNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, pWnd, OBJID_CARET, CHILDID_SELF, 0);