mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Windows: Use ScopedThreadDPIAwarenessSetter in keyboard hooks to set correct thread DPI awareness
This commit is contained in:
parent
a70488e38e
commit
d5175b6e23
1 changed files with 11 additions and 3 deletions
|
|
@ -1963,10 +1963,18 @@ public:
|
|||
static bool offerKeyMessageToJUCEWindow (MSG& m)
|
||||
{
|
||||
if (m.message == WM_KEYDOWN || m.message == WM_KEYUP)
|
||||
{
|
||||
if (Component::getCurrentlyFocusedComponent() != nullptr)
|
||||
if (auto* h = getOwnerOfWindow (m.hwnd))
|
||||
return m.message == WM_KEYDOWN ? h->doKeyDown (m.wParam)
|
||||
: h->doKeyUp (m.wParam);
|
||||
{
|
||||
if (auto* peer = getOwnerOfWindow (m.hwnd))
|
||||
{
|
||||
ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { m.hwnd };
|
||||
|
||||
return m.message == WM_KEYDOWN ? peer->doKeyDown (m.wParam)
|
||||
: peer->doKeyUp (m.wParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue