Hi,
I am writing a VST PlugIn. I need to change the mouse cursor based on the relative mouse position inside a component.
I have a function like this:
void checkAndSetMouseCursor(int x, int y)
{
if (EXP1)
currentMouseCursor = MouseCursor::LeftRightResizeCursor;
else if (EXP2)
currentMouseCursor = MouseCursor::UpDownResizeCursor;
else if (EXP3)
currentMouseCursor = MouseCursor::NormalCursor;
updateMouseCursor();
}
which I call whenever I detect mouse cursor needs an update. I have also overriden
MouseCursor getMouseCursor()
{
return currentMouseCursor;
}
which returns the currentMouseCursor
and is supposed to set the correct cursor. I also call updateMouseCursor()
in multiple locations. Like in pain() function of my component.
The problem is: when repainting and when mouse cursor is not normal arrow, for a very short moment the mouse cursor will be set back to arrow shape and then sets to whatever it was before. So what the user experiences is that the mouse cursor is flickering all the time.
Is it really my guess right? Does Juce reset the mouse cursor on repaints?
I have also added an MouseInactivityDetector to my my class and I am calling updateMouseCursor()
in mouseBecameInactive()
function, but that doesn’t help.
Please advice!
BTW I am developing on Windows 10, and using Nuendo 7 as DAW.