Re: blinking cursor

Richard Kimberly Heck <[email protected]> Sat, 3 Jan 2026 15:24:07 -0500
Newsgroups gmane.editors.lyx.general
Message-ID <[email protected]>
On 1/3/26 2:26 PM, Stephan Witt wrote:
> Am 03.01.2026 um 18:32 schrieb Richard Kimberly Heck <[email protected]>:
>>
>> On 1/3/26 12:23 PM, Paul Rubin wrote:
>>>
>>>
>>> On 1/2/26 21:19, Tom Goldring wrote:
>>>> Is there any way to turn it off in MacOS 15.7.3 or any other 
>>>> version? I find it intolerable. I tried the "Prefer non-blinking 
>>>> cursor" in my System Settings, but it doesn't work in LyX.
>>>>
>>> This is a Qt setting. The following works on Linux Mint and may be 
>>> doable on MacOS.
>>>
>>>  1. Install the Qt 5 configuration tool (qt5ct on Linux).
>>>  2. Run the tool. If you get a warning about QT_QPA_PLATFORMTHEME
>>>     not being set, you have to add the line
>>>     QT_QPA_PLATFORMTHEME=qt5ct to an appropriate configuration file
>>>     and reboot. In my case, I was able to add it to
>>>     ~/.config/qt5ct/qt5ct.conf. Other Linux users report putting it
>>>     in /etc/environment or other places. You'll have to do a little
>>>     research to find the appropriate file on a Mac.
>>>  3. Once the configuration tool is running without warnings, go to
>>>     the Interface tab and change "Cursor flash time" to 0ms. Click
>>>     Apply and then start LyX and confirm that the cursor is rock solid.
>>>
>>> Note that this will affect all apps on your system using Qt5, not 
>>> just LyX.
>>>
>> I am not sure if we use Qt5 or Qt6 with the OSX packages, but qt6ct 
>> also exists.
>>
>> Looking at the source code, we do seem to get the cursor flash time 
>> from Qt, so I'd expect us to respect this setting wherever it comes 
>> from. If it's <=0, we do not start the blinking.
>>
> We had a ticket long time ago for this:
>
> #9287 ((Accessibility) It is not possible to disable the blinking 
> cursor) – The LyX Project <https://www.lyx.org/trac/ticket/9287>
> lyx.org <https://www.lyx.org/trac/ticket/9287>
> 	trac.ico <https://www.lyx.org/trac/ticket/9287>
>
> <https://www.lyx.org/trac/ticket/9287>
>
Right, and as you said elsewhere, there's a way to do this.

Looking at the code quickly, could the calls to 
NSTextInsertionPointBlinkPeriod... be moved to 
GuiWorkArea::startBlinkingCaret, and effectively take the place of the 
calls there to QApplication::cursorFlashTime? That would make the OSX 
version work pretty much like the other ones. In particular, if this 
value were changed while LyX is running, we'd pick it up.

Also, this

#if defined(Q_OS_MAC)
     int const cursor_time_on = NSTextInsertionPointBlinkPeriodOn();
     int const cursor_time_off = NSTextInsertionPointBlinkPeriodOff();
     if (cursor_time_on > 0 && cursor_time_off > 0) {
         QApplication::setCursorFlashTime(cursor_time_on + cursor_time_off);
     } else if (cursor_time_on <= 0 && cursor_time_off > 0) {
         // Off is set and On is undefined of zero
         QApplication::setCursorFlashTime(0);
     } else if (cursor_time_off <= 0 && cursor_time_on > 0) {
         // On is set and Off is undefined of zero
         QApplication::setCursorFlashTime(0);
     }
#endif

looks overly complicated. Why not just:

     if (cursor_time_on > 0 && cursor_time_off > 0) {
         QApplication::setCursorFlashTime(cursor_time_on + cursor_time_off);
     } else
         QApplication::setCursorFlashTime(0);

? The case where they are both zero seems not to be handled.

Riki

-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users