Custom cursors flickering in S1, but works with non-juce plugins

Hello,

I tried to put custom cursors in an audio plugin, but I get a problem in studio one 5, the cursor is constantly reseted to the default one when there is a mouse event. (it works fine on other daw I tested)

I tried to force the cursor by adding a global mouselistener calling forceMouseCursorUpdate() from the main mouse source. But sometimes the normal cursor still appears really quickly, which makes the stuff feeling buggy.

I noticed on some plugins : Serum and PhasePlant, Melda prod, which are not juce based, custom cursors work perfectly with no flicker at all on Studio One 5.

Then I think it should be possible to handle custom cursor properly, and I would like to know if anyone would have an idea for that ? :slight_smile:

Thanks in advance.

PS : I already tried in the past to add custom cursors, but due to the lack of compatibility (it was not working on cubase as well, now it seems to be ok on this one, which is great), I prefered to not put any custom cursors at all.

We put an option in our plugin that lets users turn on/off custom cursors, just to handle hosts where it did this. (This was using pure VST3/VSTGUI, not JUCE.)

Thanks for your answer, anyway I’ll keep the forceMouseCursorUpdate() on each mouse event trick for now, hoping there would be a solution that would work better without no flickering at all, in the future. :slight_smile:

Has anyone found a solution to this, other than allowing users to disable custom cursors? (Only seems to happen on the PC, by the way.)

1 Like
class MouseFixer : public juce::MouseListener
{
public:
  MouseFixer()
  {
    juce::Desktop::getInstance().addGlobalMouseListener(this);
  }
  void mouseMove(const juce::MouseEvent& e) override
  {
    juce::Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
  }
  void mouseDrag(const juce::MouseEvent& e) override
  {
    juce::Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
  }
  static void init() {
    static const MouseFixer mouseFixer;
  }
};

Then you call init() in the ctor of your UI main component. It still flickers, but less. I’ll be glad that Juce offers a proper solution to this issue.