1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

mouseUp behaviour fix when components are modal.

This commit is contained in:
jules 2012-10-18 09:50:26 +01:00
parent 89d5e19fca
commit ba0cb5f2a9
2 changed files with 8 additions and 5 deletions

View file

@ -2286,11 +2286,11 @@ void Component::internalMouseExit (MouseInputSource& source, const Point<int>& r
void Component::internalMouseDown (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
{
Desktop& desktop = Desktop::getInstance();
BailOutChecker checker (this);
if (isCurrentlyBlockedByAnotherModalComponent())
{
flags.mouseDownWasBlocked = true;
internalModalInputAttempt();
if (checker.shouldBailOut())
@ -2310,6 +2310,8 @@ void Component::internalMouseDown (MouseInputSource& source, const Point<int>& r
}
}
flags.mouseDownWasBlocked = false;
for (Component* c = this; c != nullptr; c = c->parentComponent)
{
if (c->isBroughtToFrontOnMouseClick())
@ -2345,11 +2347,11 @@ void Component::internalMouseDown (MouseInputSource& source, const Point<int>& r
MouseListenerList::sendMouseEvent (*this, checker, &MouseListener::mouseDown, me);
}
void Component::internalMouseUp (MouseInputSource& source, const Point<int>& relativePos, const Time& time, const ModifierKeys& oldModifiers)
void Component::internalMouseUp (MouseInputSource& source, const Point<int>& relativePos,
const Time& time, const ModifierKeys& oldModifiers)
{
// NB: don't check whether there's a modal comp blocking this one, because if there is, it
// must have been created during a mouse-drag on this component, and if so, this comp will
// still want to get the corresponding mouse-up.
if (flags.mouseDownWasBlocked && isCurrentlyBlockedByAnotherModalComponent())
return;
BailOutChecker checker (this);

View file

@ -2255,6 +2255,7 @@ private:
bool isDisabledFlag : 1;
bool childCompFocusedFlag : 1;
bool dontClipGraphicsFlag : 1;
bool mouseDownWasBlocked : 1;
#if JUCE_DEBUG
bool isInsidePaintCall : 1;
#endif