From 051e7017806d977162aaf746a78980ed3f63d3c7 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 3 Dec 2024 14:26:21 +0000 Subject: [PATCH] Windowing: Update mousewheel handler on Windows to always process messages in the context of the peer receiving the event --- .../juce_gui_basics/native/juce_Windowing_windows.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index bf8d63c3fa..1e19b9df8c 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -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; }