Closed Cuperino closed 1 year ago
Would hiding the cursor affect animation performance?
It should not. Mouse cursors are drawn by X11 or by the shell when you're using a Wayland session. Drawing a blank image, like I've described, should not increase nor reduce GPU processing costs.
The timer used to determine when to hide the cursor would use a separate CPU thread, so there is a small CPU cost that would have its greatest impact in systems with few cores. Nonetheless, this impact should be negligible.
Would it be possible to make this a selectable option in your preferences?
What I do to keep performance optimal is perform checks to prevent unnecessary code from running. The faster the checks and the less are needed, the better. If the feature in question doesn't cost much more than performing a settings check, there may be not be a need to make this something you can disable.
Taking the overlay contrast effect as an example, that added a big layer of semi-transparent content that needed to be composited in the GPU.
The question that needs to be answered first is, will "changing the cursor image" or "running a timer" impact performance noticeably? I think it should make no difference if the new cursor image is registered to video memory from beforehand. The timer's impact should also be negligible. The Timer object would only need to be instantiated once when entering Countdown or Prompting mode. After that, the same timer would just be reset with every mouse move, meaning no extra time is dedicated to resource allocation and de-allocation while prompting; all that is used is already in memory.
Feature added to v1.2 development branch.
Request
Planned Solution
Use a transparent blank image to make all cursors invisible until its changed back:
Method to run the following code to restore normal cursor behavior:
Restore cursors when:
Cancel previous timer if it exists when:
Set 3 second countdown to make cursor blank when:
Reference