From 556f803123480b35bc06c2171a0482e7111e457f Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Tue, 10 Nov 2020 12:17:54 +0200

Subject: [PATCH 1/1] macOS: Improved scrolling using mouse wheel

This required further SDL hacking. The macOS SDL .diff was updated.

IssueID #26


...ch.diff => sdl2-macos-mouse-scrolling.diff | 14 +++++--

src/ui/documentwidget.c | 37 ++++++++++++-------

2 files changed, 35 insertions(+), 16 deletions(-)

rename sdl2-macos-mouse-scrolling-patch.diff => sdl2-macos-mouse-scrolling.diff (67%)

diff --git a/sdl2-macos-mouse-scrolling-patch.diff b/sdl2-macos-mouse-scrolling.diff

similarity index 67%

rename from sdl2-macos-mouse-scrolling-patch.diff

rename to sdl2-macos-mouse-scrolling.diff

index 633243ed..e2f30c24 100644

--- a/sdl2-macos-mouse-scrolling-patch.diff

+++ b/sdl2-macos-mouse-scrolling.diff

@@ -1,6 +1,6 @@

diff -r 4f06c06b6d19 src/events/SDL_mouse.c

--- a/src/events/SDL_mouse.c Wed Aug 05 15:28:51 2020 +0200

-+++ b/src/events/SDL_mouse.c Tue Sep 15 07:54:17 2020 +0300

++++ b/src/events/SDL_mouse.c Tue Nov 10 12:16:06 2020 +0200

@@ -642,8 +642,8 @@

      event.wheel.preciseX = x;

      event.wheel.preciseY = y;

@@ -14,8 +14,8 @@ diff -r 4f06c06b6d19 src/events/SDL_mouse.c

  }

diff -r 4f06c06b6d19 src/video/cocoa/SDL_cocoamouse.m

--- a/src/video/cocoa/SDL_cocoamouse.m Wed Aug 05 15:28:51 2020 +0200

-+++ b/src/video/cocoa/SDL_cocoamouse.m Tue Sep 15 07:54:17 2020 +0300

-@@ -424,8 +424,8 @@

++++ b/src/video/cocoa/SDL_cocoamouse.m Tue Nov 10 12:16:06 2020 +0200

+@@ -424,10 +424,16 @@

  }

  SDL_MouseID mouseID = mouse->mouseID;

@@ -25,4 +25,12 @@ diff -r 4f06c06b6d19 src/video/cocoa/SDL_cocoamouse.m

  SDL_MouseWheelDirection direction = SDL_MOUSEWHEEL_NORMAL;

++ /* HACK: Make a distinction between precise and imprecise scrolling.

++ Trackpad seems to be mouseID 0. */

++ if (![event hasPreciseScrollingDeltas]) {

++ mouseID = 1;

++ }

++

  if ([event respondsToSelector:@selector(isDirectionInvertedFromDevice)]) {

diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c

index a4bf38dc..c71758be 100644

--- a/src/ui/documentwidget.c

+++ b/src/ui/documentwidget.c

@@ -1891,21 +1891,32 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e

         }

     }

#if defined (iPlatformApple)

-#else

     }

+#endif

+#if defined (iPlatformApple)

+#else

#endif

     iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iTrue);

     return iTrue;

 }

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.10/patch/556f803123480b35bc06c2171a0482e7111e457f.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
67.96939 milliseconds
Gemini-to-HTML Time
1.646347 milliseconds

This content has been proxied by September (ba2dc).