From 65ed72e66940685b0d659bd4d1ce10b63bcf2b1a Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Mon, 14 Apr 2025 17:11:37 +0200 Subject: [PATCH] Terminal: show a different cursor when window isn't active or view is unfocused "empty" cursor when unfocused, "filled" when focused, similar to what other terminals do in other platforms Change-Id: I7ccafaacab8cfb63d8e556ca3ee76335ebb0cf0e Reviewed-on: https://review.haiku-os.org/c/haiku/+/9165 Tested-by: Commit checker robot Reviewed-by: nephele nephele --- src/apps/terminal/TermView.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index b9caedcb36..919b03fee6 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -873,10 +873,10 @@ TermView::SwitchCursorBlinking(bool blinkingOn) } else { // make sure the cursor becomes visible fCursorState = 0; - _InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y); delete fCursorBlinkRunner; fCursorBlinkRunner = NULL; } + _InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y); } @@ -1235,8 +1235,11 @@ TermView::_DrawCursor() if (attr.IsWidth() && fCursorStyle != IBEAM_CURSOR) rect.right += fFontWidth; - - FillRect(rect); + if (Window()->IsActive() && IsFocus()) { + FillRect(rect); + } else { + StrokeRect(rect); + } } }