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

Windowing: Update mousewheel handler on Windows to always process messages in the context of the peer receiving the event

This commit is contained in:
reuk 2024-12-03 14:26:21 +00:00
parent 5c138561bb
commit 051e701780

View file

@ -2895,14 +2895,8 @@ private:
// the window with focus, despite what the MSDN docs might say.
// This is the behaviour we want; if we're receiving a scroll event, we can assume it
// should be processed by the current peer.
const auto currentMousePos = getPOINTFromLParam ((LPARAM) GetMessagePos());
auto* peer = getOwnerOfWindow (WindowFromPoint (currentMousePos));
if (peer == nullptr)
return false;
const auto localPos = peer->globalToLocal (convertPhysicalScreenPointToLogical (D2DUtilities::toPoint (currentMousePos), hwnd).toFloat());
peer->handleMouseWheel (getPointerType (wParam), localPos, getMouseEventTime(), wheel);
const auto localPos = getLocalPointFromScreenLParam ((LPARAM) GetMessagePos());
handleMouseWheel (getPointerType (wParam), localPos, getMouseEventTime(), wheel);
return true;
}