mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +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:
parent
17e13c22fc
commit
803ab31d21
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue