mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 05:23:33 +08:00
[CONSRV] Don't blink cursor if the console window is not active (#5601)
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
parent
710df1361c
commit
7c2e8c67f1
@ -642,6 +642,7 @@ OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||
|
||||
GuiData->hWindow = hWnd;
|
||||
GuiData->hSysMenu = GetSystemMenu(hWnd, FALSE);
|
||||
GuiData->IsWindowActive = FALSE;
|
||||
|
||||
/* Initialize the fonts */
|
||||
if (!InitFonts(GuiData,
|
||||
@ -725,6 +726,8 @@ OnActivate(PGUI_CONSOLE_DATA GuiData, WPARAM wParam)
|
||||
|
||||
DPRINT("WM_ACTIVATE - ActivationState = %d\n", ActivationState);
|
||||
|
||||
GuiData->IsWindowActive = (ActivationState != WA_INACTIVE);
|
||||
|
||||
if ( ActivationState == WA_ACTIVE ||
|
||||
ActivationState == WA_CLICKACTIVE )
|
||||
{
|
||||
@ -1324,8 +1327,11 @@ OnTimer(PGUI_CONSOLE_DATA GuiData)
|
||||
if (GetType(Buff) == TEXTMODE_BUFFER)
|
||||
{
|
||||
/* Repaint the caret */
|
||||
InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y);
|
||||
Buff->CursorBlinkOn = !Buff->CursorBlinkOn;
|
||||
if (GuiData->IsWindowActive || Buff->CursorBlinkOn)
|
||||
{
|
||||
InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y);
|
||||
Buff->CursorBlinkOn = !Buff->CursorBlinkOn;
|
||||
}
|
||||
|
||||
if ((GuiData->OldCursor.x != Buff->CursorPosition.X) ||
|
||||
(GuiData->OldCursor.y != Buff->CursorPosition.Y))
|
||||
|
@ -50,6 +50,7 @@ typedef struct _GUI_CONSOLE_DATA
|
||||
HDESK Desktop;
|
||||
|
||||
BOOLEAN IsWindowVisible;
|
||||
BOOLEAN IsWindowActive;
|
||||
|
||||
POINT OldCursor;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user