JUCE 8.0.6, Windows 11. Tested in standalone and VST3 in reaper.
When resizing a plugin gui using the edge of the window (not the JUCE corner resizer!), mouse events are intermittently passed to a component located in the lower right hand corner of the window. It seems to be if the mouse (which is currently down and dragging the window border) crosses the component, it’s a valid entry.
As the component in question triggers an animation on mouse enter, this is problematic.
None of the standard overrides are working here, either. Checking to see if the mouse is down returns false, both via isMouseButtonDownAnywhere() and juce::Desktop::getInstance().getMainMouseSource() related queries.
This is a temporary workaround, if it helps anyone:
bool isWindowBeingResized()
{
// Check if any mouse button is down according to the OS
#if JUCE_WINDOWS
// Windows-specific solution - check if left mouse is down according to Windows
if ((GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0)
{
// Additional check: the mouse isn't reported as down in JUCE
// (which would be the case during window resize)
if (!isMouseButtonDownAnywhere())
{
return true; // Window is likely being resized
}
}
#endif
return false;
}
I’m not 100% convinced this should be treated as a bug, since Reaper’s handling of plugin window resize is “odd” to say the least. Can you repro with any other host that has sane plugin window resizing?
It does it in standalone too, so I’d wager it’s a bug. Basically mouse down states don’t seem to be detectable via the juce api if the mouse goes down outside of a juce window.