summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-04 18:06:51 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-04 18:06:51 +0200
commit829733272b2a2fe6108c9834215bd07520b69033 (patch)
treeff1861b991323e997ccf20979bbc908bece94322
parentcf37fc31c6ef9a4ed01b6b9b642b858d2b7965eb (diff)
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.
-rw-r--r--src/macos.m5
1 files changed, 4 insertions, 1 deletions
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) {
436 const iBool isInertia = (event.momentumPhase & (NSEventPhaseBegan | NSEventPhaseChanged)) != 0; 436 const iBool isInertia = (event.momentumPhase & (NSEventPhaseBegan | NSEventPhaseChanged)) != 0;
437 const iBool isEnded = event.scrollingDeltaX == 0.0f && event.scrollingDeltaY == 0.0f && !isInertia; 437 const iBool isEnded = event.scrollingDeltaX == 0.0f && event.scrollingDeltaY == 0.0f && !isInertia;
438 const iWindow *win = &get_MainWindow()->base; 438 const iWindow *win = &get_MainWindow()->base;
439 if (event.window != nsWindow_(win->win)) {
440 /* Not the main window. */
441 return iFalse;
442 }
439 if (isPerPixel) { 443 if (isPerPixel) {
440 /* On macOS 12.1, stopping ongoing inertia scroll with a tap seems to sometimes produce 444 /* On macOS 12.1, stopping ongoing inertia scroll with a tap seems to sometimes produce
441 spurious large scroll events. */ 445 spurious large scroll events. */
@@ -525,7 +529,6 @@ static iBool processScrollWheelEvent_(NSEvent *event) {
525 ev.wheel.y = iSign(ev.wheel.y); 529 ev.wheel.y = iSign(ev.wheel.y);
526 } 530 }
527#endif 531#endif
528
529 return iTrue; 532 return iTrue;
530} 533}
531 534