[NTUSER] Fix issue when cursor/caret is static

Also remove the check that Windows doesn't do.

CORE-17929
This commit is contained in:
Jose Carlos Jesus 2022-01-14 19:32:52 +00:00 committed by Stanislav Motylkov
parent c0eb407130
commit 9701bbcf6d
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -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);