From 9701bbcf6d6a4bbcdd6d0cdbe9b639dfa6cadb43 Mon Sep 17 00:00:00 2001 From: Jose Carlos Jesus Date: Fri, 14 Jan 2022 19:32:52 +0000 Subject: [PATCH] [NTUSER] Fix issue when cursor/caret is static Also remove the check that Windows doesn't do. CORE-17929 --- win32ss/user/ntuser/caret.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/win32ss/user/ntuser/caret.c b/win32ss/user/ntuser/caret.c index 24fadf6e16e..52ebb1bdb22 100644 --- a/win32ss/user/ntuser/caret.c +++ b/win32ss/user/ntuser/caret.c @@ -10,11 +10,6 @@ #include DBG_DEFAULT_CHANNEL(UserCaret); -/* DEFINES *****************************************************************/ - -#define MIN_CARETBLINKRATE 100 -#define MAX_CARETBLINKRATE 10000 - /* FUNCTIONS *****************************************************************/ VOID FASTCALL @@ -189,13 +184,6 @@ IntSetCaretBlinkTime(UINT uMSeconds) { /* Don't save the new value to the registry! */ - /* Windows doesn't do this check */ - if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - gpsi->dtCaretBlink = uMSeconds; return TRUE; @@ -300,7 +288,15 @@ BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL) { IntNotifyWinEvent(EVENT_OBJECT_SHOW, pWnd, OBJID_CARET, OBJID_CARET, 0); } - IntSetTimer(pWnd, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); + if ((INT)gpsi->dtCaretBlink > 0) + { + IntSetTimer(pWnd, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); + } + else if (ThreadQueue->CaretInfo.Visible) + { + ThreadQueue->CaretInfo.Showing = 1; + co_IntDrawCaret(pWnd, &ThreadQueue->CaretInfo); + } } return TRUE; } @@ -366,7 +362,7 @@ NtUserCreateCaret( ThreadQueue->CaretInfo.Visible = 0; ThreadQueue->CaretInfo.Showing = 0; - IntSetTimer( Window, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM ); + IntSetTimer(Window, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_CARET, CHILDID_SELF, 0);