mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoid focus changes due to mouse clicks for Components with setMouseClickGrabsKeyboardFocus (false)
Even if this focus change is being propagated up by a child Component.
This commit is contained in:
parent
a38428aa8b
commit
7650c85ba5
2 changed files with 37 additions and 6 deletions
|
|
@ -2180,13 +2180,10 @@ void Component::internalMouseDown (MouseInputSource source,
|
|||
}
|
||||
}
|
||||
|
||||
if (! flags.dontFocusOnMouseClickFlag)
|
||||
{
|
||||
grabKeyboardFocusInternal (focusChangedByMouseClick, true, FocusChangeDirection::unknown);
|
||||
grabKeyboardFocusInternal (focusChangedByMouseClick, true, FocusChangeDirection::unknown);
|
||||
|
||||
if (checker.shouldBailOut())
|
||||
return;
|
||||
}
|
||||
if (checker.shouldBailOut())
|
||||
return;
|
||||
|
||||
if (flags.repaintOnMouseActivityFlag)
|
||||
repaint();
|
||||
|
|
@ -2623,6 +2620,9 @@ void Component::takeKeyboardFocus (FocusChangeType cause, FocusChangeDirection d
|
|||
|
||||
void Component::grabKeyboardFocusInternal (FocusChangeType cause, bool canTryParent, FocusChangeDirection direction)
|
||||
{
|
||||
if (flags.dontFocusOnMouseClickFlag && cause == FocusChangeType::focusChangedByMouseClick)
|
||||
return;
|
||||
|
||||
if (! isShowing())
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue