Bug 336312 - On startup, terminal cursor blinks even though it isn't focused
Summary: On startup, terminal cursor blinks even though it isn't focused
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-16 09:37 UTC by kdebugs
Modified: 2014-07-25 01:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdebugs 2014-06-16 09:37:06 UTC
Terminal panel (Konsole) should only display a blinking cursor if it's in focus.

Reproducible: Always

Steps to Reproduce:
1. If your terminal cursor doesn't blink, change settings in Konsole (Settings, Edit Current Profile, Advanced, Blinking cursor).
2. If your terminal panel doesn't show in Dolphin, press F4, then close Dolphin.
3. Open Dolphin.

Actual Results:  
Cursor in terminal panel blinks as soon as you open Dolphin, even though the focus is in the list of files.

Expected Results:  
Cursor shouldn't blink unless the terminal panel is focused.

Once you click in the terminal panel and then click out of it, it will then correctly cease blinking.
Comment 1 Frank Reininghaus 2014-06-16 11:04:02 UTC
Thanks for the bug report.

Dolphin itself has no knowledge of Konsole's cursor settings, so I don't quite see how this could be fixed in Dolphin. Moreover, I see the same behavior in Konsole itself when I open an external Konsole window, which is unfocused initially.

Reassigning to Konsole.
Comment 2 Christoph Feck 2014-07-22 01:07:29 UTC
Not tested, but this might work:

diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index c469b25..1c7b515 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -1516,6 +1516,9 @@ void TerminalDisplay::setBlinkingCursorEnabled(bool blink)
 {
     _allowBlinkingCursor = blink;
 
+    if (!hasFocus())
+        return;
+
     if (blink && !_blinkCursorTimer->isActive())
         _blinkCursorTimer->start();
Comment 3 Frank Reininghaus 2014-07-24 18:10:22 UTC
I can confirm that your patch fixes the issue. Thanks Christoph!
Comment 4 Kurt Hindenburg 2014-07-25 01:03:04 UTC
Git commit d633ba3306aab30a6f2e60f9081c713bc2086c46 by Kurt Hindenburg.
Committed on 25/07/2014 at 01:00.
Pushed by hindenburg into branch 'KDE/4.14'.

Prevent cursor blinking when not focused at startup

Thanks to Christoph Feck for patch
FIXED-IN: 4.14

M  +3    -0    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/d633ba3306aab30a6f2e60f9081c713bc2086c46