Is it possible to make `LocalPointerIconService` p...
# compose-desktop
m
Is it possible to make
LocalPointerIconService
public on desktop, it gives us more control over the cursor. Also, we can change the pointer icon without causing recomposition. I want to change the pointer icon when I'm doing some expensive operations where I want to keep recomposition at 0.
👍 1
You can add internal or experimental annotation to it.
a
Such a tiny recomposition should not be expensive.
But as a hack, you can find the root Swing component we set the cursor on, and change it yourself.
m
It's a graphics software and the pointer icon can change on each move event depending on the cursor position.
a
I stand by my point 🙂
😄 1
m
Hmmm ok I will try it, thanks.
m
I also change the cursor to a spinning wheel in my software each time when something is running in the background and have not noticed any performance degradation by that.
thank you color 1
m
My case is a bit different: I have a big canvas where I draw drawings. I update this canvas manually using an int state that is incremented on each move event, and during this drawing process, I'm keeping recompositions at 0, so the only way to update the canvas is that int state. With this I have a smooth and stable experience. Using pointer icon modifier during drawing will break this and cause more redrawing operations, and if I start updating the canvas more than I should (more than device max fps) I will see more latency, especially when vsync in on. I'm trying to keep the update aligned with the draw.