https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9701bbcf6d6a4bbcdd6d0cdbe9b639dfa6cadb43

commit 9701bbcf6d6a4bbcdd6d0cdbe9b639dfa6cadb43
Author:     Jose Carlos Jesus <zecarlos1...@hotmail.com>
AuthorDate: Fri Jan 14 19:32:52 2022 +0000
Commit:     Stanislav Motylkov <x86co...@gmail.com>
CommitDate: Tue Oct 25 23:54:31 2022 +0300

    [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 <win32k.h>
 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);
 

Reply via email to