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

ModifierKeys: Avoid direct access to currentModifiers when reading but not writing

This commit is contained in:
reuk 2025-06-12 14:31:08 +01:00
parent 0a71227126
commit 5d7208bb54
No known key found for this signature in database
11 changed files with 64 additions and 64 deletions

View file

@ -189,7 +189,7 @@ Component* ComponentPeer::getTargetForKeyPress()
bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textCharacter)
{
return handleKeyPress (KeyPress (keyCode,
ModifierKeys::currentModifiers.withoutMouseButtons(),
ModifierKeys::getCurrentModifiers().withoutMouseButtons(),
textCharacter));
}

View file

@ -161,7 +161,7 @@ void TooltipWindow::displayTipInternal (Point<int> screenPos, const String& tip,
String TooltipWindow::getTipFor (Component& c)
{
if (detail::WindowingHelpers::isForegroundOrEmbeddedProcess (&c)
&& ! ModifierKeys::currentModifiers.isAnyMouseButtonDown())
&& ! ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown())
{
if (auto* ttc = dynamic_cast<TooltipClient*> (&c))
if (! c.isCurrentlyBlockedByAnotherModalComponent())