Announcement

Collapse
No announcement yet.

Qt 6 cursor blink rate setting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Qt 6 cursor blink rate setting

    I like a 5 Hz blinking cursor. In KDE by default, if at all, cursors blink once a second. For me, this is losing, on average, half a second of my life every time I look for the cursor. gvim is my normal editor, and it can control the blink, and firefox has a configuration ui.caretBlinkTime​ that sets the blink time.

    Gnome and Windows have settings for this, at least they did the last time I looked for them.

    Now, if one searches for this, the results are drowned by those who want to turn the blink off. I don't understand...

    Back in Qt 4 there was a configuration file where one could set the cursor blink time. This no longer worked in Qt 5, but internally, in C++, there's a method, QApplication::cursorFlashTime, that can be replaced by using LD_PRELOAD.

    With Qt 6, will the QApplication::cursorFlashTime hack still be possible? Or will there be another way to set it?
    Regards, John Little

    #2
    In a quick internet search I only came up with the possibility to set the cursor blink rate for current GTK-based desktops like GNOME, Cinnamon or MATE
    And at least there is no graphical method in Plasma 6.0.x/Frameworks 6.x/Qt 6.7.x to do this that I could find.
    If you could tell how exactly you did this in Qt 5.x I could try if this method still works in Qt 6.7.x for you tomorrow.
    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

    Comment


      #3
      Thank you, but it seems a lot of trouble to go to...
      Code:
      cat << end > qt200msblink.cpp
      class QApplication
      {
      public:
      static int cursorFlashTime();
      };
      int QApplication::cursorFlashTime()
      {
      return 200;
      }
      class QStyleHints
      {
      public:
      int cursorFlashTime() const;
      };
      int QStyleHints::cursorFlashTime() const
      {
      return 200;
      }
      ​end
      g++ -fPIC -shared qt200msblink.cpp -o qt200msblink.so
      export LD_PRELOAD=$PWD/qt200msblink.so
      konsole
      and the cursor in the konsole should be hammering, provided that the profile has blinking enabled (edit current profile, appearance, cursor tab).
      Regards, John Little

      Comment


        #4
        I just tried this in a KDE neon VM (Plasma 6.0.4/Frameworks 6.2/Qt 6.7.0/X11).

        Very blinky! --> meaning: your method works as far as I can tell.
        My eyes…
        Last edited by Schwarzer Kater; May 29, 2024, 05:38 AM.
        Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
        Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

        get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
        install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

        Comment


          #5
          Originally posted by Schwarzer Kater View Post
          I just tried this in a KDE neon VM (Plasma 6.0.4/Frameworks 6.2/Qt 6.7.0/X11).

          Very blinky! --> meaning: your method works as far as I can tell.
          Thank you!
          My eyes…
          Actually I've been boasting about how fast my brain works a little. It's a 5 Hz change I like, so most often the flash time is 400 ms. The code I posted has been simplified; I normally set the flash time via an environment variable. Setting LD_PRELOAD can cause conflicts, and it is seen as a security hole, and IIRC is being deprecated.

          <rant>
          A major problem with highly customizable UIs like KDE is that if none of the devs, or worse none of the designers on the dev team, use the customization, that customization tend to wither over time. I've come to strongly dislike Gnome because their designers don't like customizations. They seem to really want to have the power that Apple has to tell users how they should use systems. Users like me have to resort to shouting "accessibility!" at them, often and loudly.

          I think UI designers are prone to group think, fads, and showing obeisance to everything Apple does.
          </rant>
          Regards, John Little

          Comment


            #6
            OT:

            @ your rant: I think in contrary to Apple neither GNOME nor KDE employ professional UI designers (and unfortunately this sometimes shows)…
            By the way: one still can customize more things in macOS than in GNOME by default.

            Customization is one of the reasons why I prefer every other DE (except Windows) to GNOME.
            Last edited by Schwarzer Kater; May 29, 2024, 03:10 PM. Reason: addition
            Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
            Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

            get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
            install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

            Comment

            Working...
            X