From 829733272b2a2fe6108c9834215bd07520b69033 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 4 Feb 2022 18:06:51 +0200 Subject: macOS: Let other windows handle scroll events For example, trying to scroll the Sparkle release notes was not possible because the main window would scroll instead. --- src/macos.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/macos.m b/src/macos.m index ad236784..191842f6 100644 --- a/src/macos.m +++ b/src/macos.m @@ -436,6 +436,10 @@ static iBool processScrollWheelEvent_(NSEvent *event) { const iBool isInertia = (event.momentumPhase & (NSEventPhaseBegan | NSEventPhaseChanged)) != 0; const iBool isEnded = event.scrollingDeltaX == 0.0f && event.scrollingDeltaY == 0.0f && !isInertia; const iWindow *win = &get_MainWindow()->base; + if (event.window != nsWindow_(win->win)) { + /* Not the main window. */ + return iFalse; + } if (isPerPixel) { /* On macOS 12.1, stopping ongoing inertia scroll with a tap seems to sometimes produce spurious large scroll events. */ @@ -525,7 +529,6 @@ static iBool processScrollWheelEvent_(NSEvent *event) { ev.wheel.y = iSign(ev.wheel.y); } #endif - return iTrue; } -- cgit v1.2.3