1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Windows: Fix bug where stale mouse button state could get sent to windows after a window move

handlePositionChanged() is called when the window changes z-order, which
may cause a new mouse event to be synthesised if the mouse is over the
window after the z-order is updated. In this situation, we may not have
received a mouse up/down/move event to update the current modifier
flags, so we need to update them ourselves.
This commit is contained in:
reuk 2025-06-25 18:36:36 +01:00
parent 17e13c22fc
commit 803ab31d21
No known key found for this signature in database

View file

@ -3555,7 +3555,14 @@ private:
const ScopedValueSetter<bool> scope (inHandlePositionChanged, true);
if (! areOtherTouchSourcesActive())
doMouseEvent (pos, MouseInputSource::defaultPressure);
{
auto modsToSend = ModifierKeys::getCurrentModifiers();
if (! Desktop::getInstance().getMainMouseSource().isDragging())
modsToSend = modsToSend.withoutMouseButtons();
doMouseEvent (pos, MouseInputSource::defaultPressure, 0.0f, modsToSend);
}
if (! isValidPeer (this))
return true;