From 81610dc712d004e81f9bbf1feaf6433a09f56e3a Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Tue, 4 Jan 2022 08:58:15 +0200

Subject: [PATCH 1/1] SDL patch for macOS and iOS updated for 2.0.18

SDL has added multiple input sources for mice.


sdl2.0.18-macos-ios.diff | 129 +++++++++++++++++++++++++++++++++++++++

1 file changed, 129 insertions(+)

create mode 100644 sdl2.0.18-macos-ios.diff

diff --git a/sdl2.0.18-macos-ios.diff b/sdl2.0.18-macos-ios.diff

new file mode 100644

index 00000000..8c143226

--- /dev/null

+++ b/sdl2.0.18-macos-ios.diff

@@ -0,0 +1,129 @@

+diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c

+index 539f17138..a5a5b00fd 100644

+--- a/src/events/SDL_mouse.c

++++ b/src/events/SDL_mouse.c

+@@ -709,8 +709,8 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, S

+- event.wheel.x = integral_x;

+- event.wheel.y = integral_y;

++ event.wheel.x = x; //integral_x;

++ event.wheel.y = y; //integral_y;

+diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m

+index e9d832d64..4cfa3624b 100644

+--- a/src/video/cocoa/SDL_cocoamouse.m

++++ b/src/video/cocoa/SDL_cocoamouse.m

+@@ -463,10 +463,16 @@ + (NSCursor *)invisibleCursor

+- CGFloat x = -[event deltaX];

+- CGFloat y = [event deltaY];

++ CGFloat x = -[event scrollingDeltaX];

++ CGFloat y = [event scrollingDeltaY];

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

++ Trackpad seems to be mouseID 0. */

++ if (![event hasPreciseScrollingDeltas]) {

++ mouseID = 1;

++ }

++

+diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h

+index 489db169f..79a41dd50 100644

+--- a/src/video/cocoa/SDL_cocoawindow.h

++++ b/src/video/cocoa/SDL_cocoawindow.h

+@@ -110,6 +110,8 @@ typedef enum

++-(void) syncMouseButtonAndKeyboardModifierState;

++

+diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m

+index f09088c45..7379c2269 100644

+--- a/src/video/cocoa/SDL_cocoawindow.m

++++ b/src/video/cocoa/SDL_cocoawindow.m

+@@ -1236,6 +1236,25 @@ - (void)otherMouseDown:(NSEvent *)theEvent

++- (void)syncMouseButtonAndKeyboardModifierState {

++ SDL_Mouse *mouse = SDL_GetMouse();

++ if (mouse) {

++ for (int i = 0; i < mouse->num_sources; i++) {

++ if (mouse->sources[i].mouseID == mouse->mouseID) {

++ mouse->sources[i].buttonstate = 0;

++ }

++ }

++ }

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LGUI);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RGUI);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LCTRL);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RCTRL);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LALT);

++ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RALT);

++}

++

+diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h

+index f7f4c9de6..50c72aad0 100644

+--- a/src/video/uikit/SDL_uikitviewcontroller.h

++++ b/src/video/uikit/SDL_uikitviewcontroller.h

+@@ -58,10 +58,13 @@

++- (void)setStatusStyle:(UIStatusBarStyle)style;

++- (UIStatusBarStyle)preferredStatusBarStyle;

++@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;

+diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m

+index b2db4037d..d39f8085c 100644

+--- a/src/video/uikit/SDL_uikitviewcontroller.m

++++ b/src/video/uikit/SDL_uikitviewcontroller.m

+@@ -105,6 +105,7 @@ - (instancetype)initWithSDLWindow:(SDL_Window *)_window

++ self.statusBarStyle = UIStatusBarStyleDefault;

+@@ -230,6 +231,17 @@ - (BOOL)prefersHomeIndicatorAutoHidden

++- (void)setStatusStyle:(UIStatusBarStyle)style

++{

++ self.statusBarStyle = style;

++ [self setNeedsStatusBarAppearanceUpdate];

++}

++

++- (UIStatusBarStyle)preferredStatusBarStyle

++{

++ return self.statusBarStyle;

++}

++

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/release/patch/cebb9c17c3147198c6cfbf5a560fc9e7a454fa49.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
29.641905 milliseconds
Gemini-to-HTML Time
2.709964 milliseconds

This content has been proxied by September (ba2dc).