Neutron 3 Stopping Window Drags

I’ve got a bit of a weird problem on macOS with iZotope plugins.
When you drag a JUCE window header, as soon as the mouse enters the plugin area, the mouse drag stops. This makes is basically impossible to drag a window down the screen.

It looks like what’s happening in the iZotope plugin (Neutron 3 in this case) has an NSTrackingArea registered which is sending a mouse enter event on to JUCE which is then obviously interrupting the drag.


Has anyone seen anything like this before or have any good ideas about how to stop this happening?
I did wonder if there’s a trick to make the JUCE window modal whilst the drag is happening but it feels a bit hacky…

4 Likes

I came here to post this problem myself. I have a proposed solution, but I don’t know if it’s dangerous:

    void redirectMouseEnter (NSEvent* ev)
    {
        //TEST FIX - start
        if(Desktop::getInstance().getMainMouseSource().isDragging()) {
            return;
        }
        //TEST FIX - stop
        
        Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
        ModifierKeys::currentModifiers = ModifierKeys::currentModifiers.withoutMouseButtons();
        sendMouseEvent (ev);
    }

    void redirectMouseExit (NSEvent* ev)
    {
        //TEST FIX - start
        if(Desktop::getInstance().getMainMouseSource().isDragging()) {
            return;
        }
        //TEST FIX - stop
        
        ModifierKeys::currentModifiers = ModifierKeys::currentModifiers.withoutMouseButtons();
        sendMouseEvent (ev);
    }

This fix checks whether the main mouse source is dragging, and if it is, we bail. I’m hoping someone here can tell me either that this is a good fix or that it’s a bad idea because it will cause such-and-such problems.

Thanks for your patience with this issue. The problem should be fixed by this patch:

Please let me know if you run into any further issues with this change.

2 Likes

Awesome! Thanks so much.