Massive mouse-UP delay when dragging Mouse in VST (+Solution)

When there is much going on in Cubase (Win64) in heavy weight projects(only) and you write automation (causes massive message-thread load) and you drag something in your plugin-GUI, the mouse-UP event is massively delayed (up to 30 seconds)

So if you move your mouse after you release the mouse-button, the dragging operation is still active.

(mouse-move & and repaints still happen)

(Other non juce plugin have also visual lag (which is okay in the situation of heavy load), but don't have this wrong dragging behavior)

Finally if found the reason, after a four hour research,  tryMasterIdle() some how blocks the dragging operation, and prevents the mouse-UP event to come through. (Mouse move events will still work)

So finally i fixed the problem by increasing the max-time between to Idle calls drastically to one second minimum (redraw is also much smoother)

Maybe its also interesting to not call the masterIdle function when its not needed (when the host calls the idle-function, we know it has control over the message thread?! maybe)  


    void tryMasterIdle()
    {
        if (Component::isMouseButtonDownAnywhere() && ! recursionCheck )
        {
            const juce::uint32 now = juce::Time::getMillisecondCounter();
            if (now > lastMasterIdleCall + 1000 && editorComp != nullptr)
            {
                lastMasterIdleCall = now;
                recursionCheck = true;
                masterIdle();
                recursionCheck = false;
            }
        }
    }
 

 

 

bump

Thanks for the info.

TBH the whole "idle" system is a ridiculous throwback to MacOS-9 mouse-tracking loops and the very early VST implementations. It's hard to imagine that any host written within the last 10 years would actually rely on it being called.

Looking at it again now, we all think it's best flushed away down the toilet of history, so I'm going to remove it altogether. Obviously if anyone hits any strange problems that result from this, let us know!