summaryrefslogtreecommitdiff
path: root/sdl2-macos-ios.diff
diff options
context:
space:
mode:
Diffstat (limited to 'sdl2-macos-ios.diff')
-rw-r--r--sdl2-macos-ios.diff85
1 files changed, 85 insertions, 0 deletions
diff --git a/sdl2-macos-ios.diff b/sdl2-macos-ios.diff
new file mode 100644
index 00000000..04d0f2e5
--- /dev/null
+++ b/sdl2-macos-ios.diff
@@ -0,0 +1,85 @@
1Only in SDL2-2.0.14/src: .DS_Store
2diff -ru SDL2-2.0.14-original/src/events/SDL_mouse.c SDL2-2.0.14/src/events/SDL_mouse.c
3--- SDL2-2.0.14-original/src/events/SDL_mouse.c 2020-12-21 19:44:36.000000000 +0200
4+++ SDL2-2.0.14/src/events/SDL_mouse.c 2021-01-06 18:31:18.000000000 +0200
5@@ -647,8 +647,8 @@
6 event.wheel.preciseX = x;
7 event.wheel.preciseY = y;
8 #endif
9- event.wheel.x = integral_x;
10- event.wheel.y = integral_y;
11+ event.wheel.x = x; //integral_x;
12+ event.wheel.y = y; //integral_y;
13 event.wheel.direction = (Uint32)direction;
14 posted = (SDL_PushEvent(&event) > 0);
15 }
16Only in SDL2-2.0.14/src/video: .DS_Store
17diff -ru SDL2-2.0.14-original/src/video/cocoa/SDL_cocoamouse.m SDL2-2.0.14/src/video/cocoa/SDL_cocoamouse.m
18--- SDL2-2.0.14-original/src/video/cocoa/SDL_cocoamouse.m 2020-12-21 19:44:36.000000000 +0200
19+++ SDL2-2.0.14/src/video/cocoa/SDL_cocoamouse.m 2021-01-06 18:31:18.000000000 +0200
20@@ -423,10 +423,16 @@
21 }
22
23 SDL_MouseID mouseID = mouse->mouseID;
24- CGFloat x = -[event deltaX];
25- CGFloat y = [event deltaY];
26+ CGFloat x = -[event scrollingDeltaX];
27+ CGFloat y = [event scrollingDeltaY];
28 SDL_MouseWheelDirection direction = SDL_MOUSEWHEEL_NORMAL;
29
30+ /* HACK: Make a distinction between precise and imprecise scrolling.
31+ Trackpad seems to be mouseID 0. */
32+ if (![event hasPreciseScrollingDeltas]) {
33+ mouseID = 1;
34+ }
35+
36 if ([event respondsToSelector:@selector(isDirectionInvertedFromDevice)]) {
37 if ([event isDirectionInvertedFromDevice] == YES) {
38 direction = SDL_MOUSEWHEEL_FLIPPED;
39Only in SDL2-2.0.14/src/video/cocoa: SDL_cocoamouse.m.orig
40diff -ru SDL2-2.0.14-original/src/video/uikit/SDL_uikitviewcontroller.h SDL2-2.0.14/src/video/uikit/SDL_uikitviewcontroller.h
41--- SDL2-2.0.14-original/src/video/uikit/SDL_uikitviewcontroller.h 2020-12-21 19:44:36.000000000 +0200
42+++ SDL2-2.0.14/src/video/uikit/SDL_uikitviewcontroller.h 2021-05-17 13:11:13.000000000 +0300
43@@ -58,10 +58,13 @@
44 #if !TARGET_OS_TV
45 - (NSUInteger)supportedInterfaceOrientations;
46 - (BOOL)prefersStatusBarHidden;
47+- (void)setStatusStyle:(UIStatusBarStyle)style;
48+- (UIStatusBarStyle)preferredStatusBarStyle;
49 - (BOOL)prefersHomeIndicatorAutoHidden;
50 - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures;
51
52 @property (nonatomic, assign) int homeIndicatorHidden;
53+@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
54 #endif
55
56 #if SDL_IPHONE_KEYBOARD
57diff -ru SDL2-2.0.14-original/src/video/uikit/SDL_uikitviewcontroller.m SDL2-2.0.14/src/video/uikit/SDL_uikitviewcontroller.m
58--- SDL2-2.0.14-original/src/video/uikit/SDL_uikitviewcontroller.m 2020-12-21 19:44:36.000000000 +0200
59+++ SDL2-2.0.14/src/video/uikit/SDL_uikitviewcontroller.m 2021-05-17 13:11:58.000000000 +0300
60@@ -104,6 +104,7 @@
61 #endif
62
63 #if !TARGET_OS_TV
64+ self.statusBarStyle = UIStatusBarStyleDefault;
65 SDL_AddHintCallback(SDL_HINT_IOS_HIDE_HOME_INDICATOR,
66 SDL_HideHomeIndicatorHintChanged,
67 (__bridge void *) self);
68@@ -229,6 +230,17 @@
69 return hidden;
70 }
71
72+- (void)setStatusStyle:(UIStatusBarStyle)style
73+{
74+ self.statusBarStyle = style;
75+ [self setNeedsStatusBarAppearanceUpdate];
76+}
77+
78+- (UIStatusBarStyle)preferredStatusBarStyle
79+{
80+ return self.statusBarStyle;
81+}
82+
83 - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
84 {
85 if (self.homeIndicatorHidden >= 0) {