Bug 343635 - No way to set cursor blink rate / cursorFlashTime
Summary: No way to set cursor blink rate / cursorFlashTime
Status: REPORTED
Alias: None
Product: frameworks-frameworkintegration
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources All
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-31 20:15 UTC by Thomas Backman
Modified: 2024-02-24 08:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Backman 2015-01-31 20:15:38 UTC
(Plasma 5.2/frameworkintegration 5.6.0)

By default, the text cursor blinks in KDE and in Qt 5 apps (and likely in others). However, there is no option to change the blink rate, or disable blinking altogether.
This may not be an issue for most, but some find the blinking annoying, particularly in applications which use large/block cursors, rather than thin vertical bars.

For older Qt versions, there is qtconfig, which can adjust the Qt cursorFlashTime parameter in a system-wide way. For Qt 5 and KDE Plasma 5.2, the only solution I've found is to use LD_PRELOAD to override the default value.

Apologies if this bug is misfiled; I really have no idea where it fits best; System Settings > Keyboard may be a reasonable place for the setting.
I chose frameworkintegration after looking through the Qt source (qtbase/src/gui/kernel/qstylehints.cpp), and finding that QStyleHints::cursorFlashTime can get its value from either QPlatformTheme::CursorFlashTime or QPlatformIntegration::CursorFlashTime.

LD_PRELOAD solution that works in the meantime, for others who might find this bug: https://github.com/igogo/qt5noblink
The same hack should be able to adjust the blink rate, simply by adjusting the return 0 to a value in milliseconds (the default appears to be 1000 ms).
Comment 1 Shawn Starr 2015-05-09 06:46:07 UTC
I confirm this also, I originally added a patch to Konsole to get QApplication::cursorFlashTime() and use this, this is now broken as we don't have qtconfig for Qt5.

I wonder if we should add an option the System Settings -> Keyboard  KCM plugin as you say.
Comment 2 Shawn Starr 2015-05-09 06:49:06 UTC
This would be to modify kcm_keyboard to add this option
Comment 3 Shawn Starr 2015-08-14 16:52:25 UTC
This got moved to plasma-desktop/kcms/keyboard, I will look into restoring this functionality for KDE 5 Frameworks.
Comment 4 John Little 2015-08-15 02:37:45 UTC
(In reply to Thomas Backman from comment #0)

> LD_PRELOAD solution that works in the meantime, for others who might find
> this bug: https://github.com/igogo/qt5noblink
> The same hack should be able to adjust the blink rate, simply by adjusting
> the return 0 to a value in milliseconds (the default appears to be 1000 ms).

Thank you for that.  Ironically, it doesn't work to suppress the blink, in konsole the cursor flashes frenetically, with two cores at 60%.  But I want a 4 Hz blink, and 250 works nicely.
Comment 5 kderocks38 2024-02-21 17:53:28 UTC
Hi, is it possible to review this? CursorBlinkRate=0 in the KDE section of .config/kdeglobals does not have any effect anymore.
Comment 6 Arek Guzinski 2024-02-24 08:40:46 UTC
> Hi, is it possible to review this? CursorBlinkRate=0 in the KDE section of .config/kdeglobals does not have any effect anymore.

You had me scared there!
But I can't confirm this. It still works for me on current Neon. I also installed Neon unstable (with Plasma 6.1dev) in a VM and disabling the blinking cursor worked there, too.

Would be nice if we could configure this in system settings...