sqlitebrowser icon indicating copy to clipboard operation
sqlitebrowser copied to clipboard

[Bug]: Cursor blink settings are not respected on macOS

Open dmattera opened this issue 3 years ago • 7 comments

What did you do?

For example, on macOS (10.15.7 and above as far as I know) you can set your text cursor to not blink at all by running the following commands in a terminal:

defaults write -g NSTextInsertionPointBlinkPeriodOn -float 9999999

defaults write -g NSTextInsertionPointBlinkPeriodOff -float 1

What did you expect to see?

For the tect cursors in DB4S to not blink.

What did you see instead?

In DB4S, the cursor still blinks.

DB4S Version

3.12.2

What OS are you seeing the problem on?

MacOS

OS version

macOS 10.15.7

Relevant log output

No response

Prevention against duplicate issues

  • [X] I have searched for similar issues

dmattera avatar Aug 01 '22 02:08 dmattera

Well, it's not a bug per se - the Qt control is independent of the OS settings. It's just a control. The OS blink rate could be obtained and passed to the control, but we'd have to do that across different OS's, and then version A of OS A does it this way, but version B of OS A does it that way, etc - its like the 'dark mode' for the style... I'll mark it as an enhancement, but I'm not even sure if the Qt controls have a blink rate setting.

chrisjlocke avatar Aug 01 '22 07:08 chrisjlocke

Thanks Chris.

I did some quick searching and it looks like it can be controlled in Qt via the cursorFlashTime property

https://doc.qt.io/qt-5/qapplication.html#cursorFlashTime-prop

dmattera avatar Aug 01 '22 12:08 dmattera

Looks like it gets it value from the OS if the OS is Windows or Mac ... boo sucks if you're on Linux... 😂😉

chrisjlocke avatar Aug 01 '22 13:08 chrisjlocke

Hmm, I don't see anything in that documentation indicating anything about how/where Qt is getting its value from for macOS specifically, only notes on the values it uses for Windows and X11:

The default value on X11 is 1000 milliseconds. On Windows, the Control Panel value is used and setting this property sets the cursor flash time for all applications.

I think that's kinda the point of all this, that Qt on macOS isn't respecting the OS-level setting.

I'm not all that familiar with Qt in general but did some more looking around and seems like applications on Linux using Qt will respect a Qt-specific config file. Any idea if something like this would work here on macOS?

https://www.linuxquestions.org/questions/linux-desktop-74/is-there-like-a-qt-environment-variable-or-something-i-can-use-to-stop-text-cursor-blinking-4175702530/

(I tried the 3 suggested .conf files listed in that thread on mine but no dice)

dmattera avatar Aug 01 '22 14:08 dmattera

"On Windows and Mac OS, the operating system's value is used."

Have no idea if you can use a config file. For other Qt issues, environment variables/settings have been used. There might be one for this that can be used? I'm not a Qt developer unfortunately, so have no experience in this side of it.

chrisjlocke avatar Aug 01 '22 15:08 chrisjlocke

Ah OK gotcha. I'll do some more digging on if/how a "generic" Qt config file might be able to be used for any Qt app on macOS.

"On Windows and Mac OS, the operating system's value is used."

I think you might be looking at the next section down which is for a different property called doubleClickInterval (I did the same thing myself the first time I looked).

dmattera avatar Aug 01 '22 16:08 dmattera

Dang! Oops! Well spotted!

chrisjlocke avatar Aug 03 '22 16:08 chrisjlocke