diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 30b1dc9501..2b8d5779ac 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -73865,10 +73865,10 @@ public: comp->internalMouseDrag (source, comp->getLocalPoint (nullptr, screenPos), time); } - void sendMouseUp (Component* const comp, const Point& screenPos, const Time& time) + void sendMouseUp (Component* const comp, const Point& screenPos, const Time& time, const ModifierKeys& oldMods) { //DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp)); - comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, getCurrentModifiers()); + comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, oldMods); } void sendMouseWheel (Component* const comp, const Point& screenPos, const Time& time, float x, float y) @@ -73899,7 +73899,12 @@ public: Component* const current = getComponentUnderMouse(); if (current != nullptr) - sendMouseUp (current, screenPos + unboundedMouseOffset, time); + { + const ModifierKeys oldMods (getCurrentModifiers()); + buttonState = newButtonState; // must change this before calling sendMouseUp, in case it runs a modal loop + + sendMouseUp (current, screenPos + unboundedMouseOffset, time, oldMods); + } enableUnboundedMouseMovement (false, false); } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 31a4c29a26..11493ecea2 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 54 -#define JUCE_BUILDNUMBER 25 +#define JUCE_BUILDNUMBER 27 /** Current Juce version number. diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 4d1d81e458..235fb208d3 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 54 -#define JUCE_BUILDNUMBER 25 +#define JUCE_BUILDNUMBER 27 /** Current Juce version number. diff --git a/src/gui/components/mouse/juce_MouseInputSource.cpp b/src/gui/components/mouse/juce_MouseInputSource.cpp index f9b22ff19a..70951027fe 100644 --- a/src/gui/components/mouse/juce_MouseInputSource.cpp +++ b/src/gui/components/mouse/juce_MouseInputSource.cpp @@ -128,10 +128,10 @@ public: comp->internalMouseDrag (source, comp->getLocalPoint (nullptr, screenPos), time); } - void sendMouseUp (Component* const comp, const Point& screenPos, const Time& time) + void sendMouseUp (Component* const comp, const Point& screenPos, const Time& time, const ModifierKeys& oldMods) { //DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp)); - comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, getCurrentModifiers()); + comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, oldMods); } void sendMouseWheel (Component* const comp, const Point& screenPos, const Time& time, float x, float y) @@ -163,7 +163,12 @@ public: Component* const current = getComponentUnderMouse(); if (current != nullptr) - sendMouseUp (current, screenPos + unboundedMouseOffset, time); + { + const ModifierKeys oldMods (getCurrentModifiers()); + buttonState = newButtonState; // must change this before calling sendMouseUp, in case it runs a modal loop + + sendMouseUp (current, screenPos + unboundedMouseOffset, time, oldMods); + } enableUnboundedMouseMovement (false, false); }