[1mdiff --git a/sdl2.26-macos-ios.diff b/sdl2.26-macos-ios.diff[m
[1mnew file mode 100644[m
[1mindex 00000000..3adcf1c2[m
[1m--- /dev/null[m
[1m+++ b/sdl2.26-macos-ios.diff[m
[36m@@ -0,0 +1,226 @@[m
[32m+[m[32mdiff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c[m
[32m+[m[32mindex 994b6a6db..b332e1332 100644[m
[32m+[m[32m--- a/src/events/SDL_mouse.c[m
[32m+[m[32m+++ b/src/events/SDL_mouse.c[m
[32m+[m[32m@@ -887,8 +887,8 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, S[m
[32m+[m[32m event.type = SDL_MOUSEWHEEL;[m
[32m+[m[32m event.wheel.windowID = mouse->focus ? mouse->focus->id : 0;[m
[32m+[m[32m event.wheel.which = mouseID;[m
[32m+[m[32m- event.wheel.x = integral_x;[m
[32m+[m[32m- event.wheel.y = integral_y;[m
[32m+[m[32m+ event.wheel.x = x; //integral_x;[m
[32m+[m[32m+ event.wheel.y = y; //integral_y;[m
[32m+[m[32m event.wheel.preciseX = x;[m
[32m+[m[32m event.wheel.preciseY = y;[m
[32m+[m[32m event.wheel.direction = (Uint32)direction;[m
[32m+[m[32mdiff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c[m
[32m+[m[32mindex 3424a8254..08ae827dc 100644[m
[32m+[m[32m--- a/src/video/android/SDL_androidevents.c[m
[32m+[m[32m+++ b/src/video/android/SDL_androidevents.c[m
[32m+[m[32m@@ -176,10 +176,12 @@ Android_PumpEvents_Blocking(_THIS)[m
[32m+[m[32m }[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m+ /* Doesn't actually seem to work ??[m
[32m+[m[32m if ( aaudio_DetectBrokenPlayState() ) {[m
[32m+[m[32m aaudio_PauseDevices();[m
[32m+[m[32m aaudio_ResumeDevices();[m
[32m+[m[32m }[m
[32m+[m[32m+ */[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m void[m
[32m+[m[32mdiff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m[m
[32m+[m[32mindex da5ffac69..49ab6fe14 100644[m
[32m+[m[32m--- a/src/video/cocoa/SDL_cocoamouse.m[m
[32m+[m[32m+++ b/src/video/cocoa/SDL_cocoamouse.m[m
[32m+[m[32m@@ -519,11 +519,22 @@ + (NSCursor *)invisibleCursor[m
[32m+[m[32m return;[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m+ SDL_MouseID mouseID = mouse->mouseID;[m
[32m+[m[32m+ CGFloat x = -[event scrollingDeltaX];[m
[32m+[m[32m+ CGFloat y = [event scrollingDeltaY];[m
[32m+[m[32m+ SDL_MouseWheelDirection direction = SDL_MOUSEWHEEL_NORMAL;[m
[32m+[m[32m+[m
[32m+[m[32m mouseID = mouse->mouseID;[m
[32m+[m[32m x = -[event deltaX];[m
[32m+[m[32m y = [event deltaY];[m
[32m+[m[32m direction = SDL_MOUSEWHEEL_NORMAL;[m
[32m+[m[41m [m
[32m+[m[32m+ /* HACK: Make a distinction between precise and imprecise scrolling.[m
[32m+[m[32m+ Trackpad seems to be mouseID 0. */[m
[32m+[m[32m+ if (![event hasPreciseScrollingDeltas]) {[m
[32m+[m[32m+ mouseID = 1;[m
[32m+[m[32m+ }[m
[32m+[m[32m+[m
[32m+[m[32m if ([event isDirectionInvertedFromDevice] == YES) {[m
[32m+[m[32m direction = SDL_MOUSEWHEEL_FLIPPED;[m
[32m+[m[32m }[m
[32m+[m[32mdiff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h[m
[32m+[m[32mindex 18f7d8587..1329a90ab 100644[m
[32m+[m[32m--- a/src/video/cocoa/SDL_cocoawindow.h[m
[32m+[m[32m+++ b/src/video/cocoa/SDL_cocoawindow.h[m
[32m+[m[32m@@ -115,6 +115,8 @@ typedef enum[m
[32m+[m[32m /* Touch event handling */[m
[32m+[m[32m -(void) handleTouches:(NSTouchPhase) phase withEvent:(NSEvent*) theEvent;[m
[32m+[m[41m [m
[32m+[m[32m+-(void) syncMouseButtonAndKeyboardModifierState;[m
[32m+[m[32m+[m
[32m+[m[32m @end[m
[32m+[m[32m /* INDENT-ON */[m
[32m+[m[41m [m
[32m+[m[32mdiff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m[m
[32m+[m[32mindex c73827656..786f288a2 100644[m
[32m+[m[32m--- a/src/video/cocoa/SDL_cocoawindow.m[m
[32m+[m[32m+++ b/src/video/cocoa/SDL_cocoawindow.m[m
[32m+[m[32m@@ -1273,6 +1273,25 @@ - (void)otherMouseDown:(NSEvent *)theEvent[m
[32m+[m[32m [self mouseDown:theEvent];[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m+- (void)syncMouseButtonAndKeyboardModifierState {[m
[32m+[m[32m+ SDL_Mouse *mouse = SDL_GetMouse();[m
[32m+[m[32m+ if (mouse) {[m
[32m+[m[32m+ for (int i = 0; i < mouse->num_sources; i++) {[m
[32m+[m[32m+ if (mouse->sources[i].mouseID == mouse->mouseID) {[m
[32m+[m[32m+ mouse->sources[i].buttonstate = 0;[m
[32m+[m[32m+ }[m
[32m+[m[32m+ }[m
[32m+[m[32m+ }[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LGUI);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RGUI);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LCTRL);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RCTRL);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LALT);[m
[32m+[m[32m+ SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RALT);[m
[32m+[m[32m+}[m
[32m+[m[32m+[m
[32m+[m[32m - (void)mouseUp:(NSEvent *)theEvent[m
[32m+[m[32m {[m
[32m+[m[32m SDL_Mouse *mouse = SDL_GetMouse();[m
[32m+[m[32mdiff --git a/src/video/uikit/SDL_uikitappdelegate.h b/src/video/uikit/SDL_uikitappdelegate.h[m
[32m+[m[32mindex ee2b5b6a8..8a7f81f62 100644[m
[32m+[m[32m--- a/src/video/uikit/SDL_uikitappdelegate.h[m
[32m+[m[32m+++ b/src/video/uikit/SDL_uikitappdelegate.h[m
[32m+[m[32m@@ -34,6 +34,7 @@[m
[32m+[m[32m + (id)sharedAppDelegate;[m
[32m+[m[32m + (NSString *)getAppDelegateClassName;[m
[32m+[m[41m [m
[32m+[m[32m+- (NSString *)getLaunchOptionsURL;[m
[32m+[m[32m - (void)hideLaunchScreen;[m
[32m+[m[41m [m
[32m+[m[32m /* This property is marked as optional, and is only intended to be used when[m
[32m+[m[32mdiff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m[m
[32m+[m[32mindex 3186cc6e8..dfa6c9307 100644[m
[32m+[m[32m--- a/src/video/uikit/SDL_uikitappdelegate.m[m
[32m+[m[32m+++ b/src/video/uikit/SDL_uikitappdelegate.m[m
[32m+[m[32m@@ -25,6 +25,7 @@[m
[32m+[m[32m #include "../SDL_sysvideo.h"[m
[32m+[m[32m #include "SDL_hints.h"[m
[32m+[m[32m #include "SDL_system.h"[m
[32m+[m[32m+#include "SDL_timer.h"[m
[32m+[m[32m #include "SDL_main.h"[m
[32m+[m[41m [m
[32m+[m[32m #import "SDL_uikitappdelegate.h"[m
[32m+[m[32m@@ -181,6 +182,8 @@ - (NSUInteger)supportedInterfaceOrientations;[m
[32m+[m[41m [m
[32m+[m[32m @end[m
[32m+[m[41m [m
[32m+[m[32m+static NSString *launchOptionsURL;[m
[32m+[m[32m+[m
[32m+[m[32m @implementation SDLLaunchScreenController[m
[32m+[m[41m [m
[32m+[m[32m - (instancetype)init[m
[32m+[m[32m@@ -364,6 +367,11 @@ + (NSString *)getAppDelegateClassName[m
[32m+[m[32m return @"SDLUIKitDelegate";[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m+- (NSString *)getLaunchOptionsURL[m
[32m+[m[32m+{[m
[32m+[m[32m+ return launchOptionsURL;[m
[32m+[m[32m+}[m
[32m+[m[32m+[m
[32m+[m[32m - (void)hideLaunchScreen[m
[32m+[m[32m {[m
[32m+[m[32m UIWindow *window = launchWindow;[m
[32m+[m[32m@@ -387,7 +395,7 @@ - (void)postFinishLaunch[m
[32m+[m[32m {[m
[32m+[m[32m /* Hide the launch screen the next time the run loop is run. SDL apps will[m
[32m+[m[32m * have a chance to load resources while the launch screen is still up. */[m
[32m+[m[32m- [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0];[m
[32m+[m[32m+ //[self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0];[m
[32m+[m[41m [m
[32m+[m[32m /* run the user's application, passing argc and argv */[m
[32m+[m[32m SDL_iPhoneSetEventPump(SDL_TRUE);[m
[32m+[m[32m@@ -421,6 +429,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:([m
[32m+[m[41m [m
[32m+[m[32m /* tvOS only uses a plain launch image. */[m
[32m+[m[32m #if !TARGET_OS_TV[m
[32m+[m[32m+[m
[32m+[m[32m+ NSURL *url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];[m
[32m+[m[32m+ if (url != nil) {[m
[32m+[m[32m+ launchOptionsURL = [url absoluteString];[m
[32m+[m[32m+ }[m
[32m+[m[32m+[m[41m [m
[32m+[m[32m screenname = [bundle objectForInfoDictionaryKey:@"UILaunchStoryboardName"];[m
[32m+[m[41m [m
[32m+[m[32m if (screenname) {[m
[32m+[m[32m@@ -428,7 +442,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:([m
[32m+[m[32m /* The launch storyboard is actually a nib in some older versions of[m
[32m+[m[32m * Xcode. We'll try to load it as a storyboard first, as it's more[m
[32m+[m[32m * modern. */[m
[32m+[m[32m- UIStoryboard *storyboard = [UIStoryboard storyboardWithName:screenname bundle:bundle];[m
[32m+[m[32m+ UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:bundle];[m
[32m+[m[32m __auto_type storyboardVc = [storyboard instantiateInitialViewController];[m
[32m+[m[32m vc = [[SDLLaunchStoryboardViewController alloc] initWithStoryboardViewController:storyboardVc];[m
[32m+[m[32m }[m
[32m+[m[32mdiff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h[m
[32m+[m[32mindex 2e64a5279..256be3073 100644[m
[32m+[m[32m--- a/src/video/uikit/SDL_uikitviewcontroller.h[m
[32m+[m[32m+++ b/src/video/uikit/SDL_uikitviewcontroller.h[m
[32m+[m[32m@@ -58,10 +58,13 @@[m
[32m+[m[32m #if !TARGET_OS_TV[m
[32m+[m[32m - (NSUInteger)supportedInterfaceOrientations;[m
[32m+[m[32m - (BOOL)prefersStatusBarHidden;[m
[32m+[m[32m+- (void)setStatusStyle:(UIStatusBarStyle)style;[m
[32m+[m[32m+- (UIStatusBarStyle)preferredStatusBarStyle;[m
[32m+[m[32m - (BOOL)prefersHomeIndicatorAutoHidden;[m
[32m+[m[32m - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures;[m
[32m+[m[41m [m
[32m+[m[32m @property (nonatomic, assign) int homeIndicatorHidden;[m
[32m+[m[32m+@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;[m
[32m+[m[32m #endif[m
[32m+[m[41m [m
[32m+[m[32m #if SDL_IPHONE_KEYBOARD[m
[32m+[m[32mdiff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m[m
[32m+[m[32mindex ee7ee83b0..f3cda52c8 100644[m
[32m+[m[32m--- a/src/video/uikit/SDL_uikitviewcontroller.m[m
[32m+[m[32m+++ b/src/video/uikit/SDL_uikitviewcontroller.m[m
[32m+[m[32m@@ -101,6 +101,7 @@ - (instancetype)initWithSDLWindow:(SDL_Window *)_window[m
[32m+[m[32m #endif[m
[32m+[m[41m [m
[32m+[m[32m #if !TARGET_OS_TV[m
[32m+[m[32m+ self.statusBarStyle = UIStatusBarStyleDefault;[m
[32m+[m[32m SDL_AddHintCallback(SDL_HINT_IOS_HIDE_HOME_INDICATOR,[m
[32m+[m[32m SDL_HideHomeIndicatorHintChanged,[m
[32m+[m[32m (__bridge void *) self);[m
[32m+[m[32m@@ -219,6 +220,17 @@ - (BOOL)prefersHomeIndicatorAutoHidden[m
[32m+[m[32m return hidden;[m
[32m+[m[32m }[m
[32m+[m[41m [m
[32m+[m[32m+- (void)setStatusStyle:(UIStatusBarStyle)style[m
[32m+[m[32m+{[m
[32m+[m[32m+ self.statusBarStyle = style;[m
[32m+[m[32m+ [self setNeedsStatusBarAppearanceUpdate];[m
[32m+[m[32m+}[m
[32m+[m[32m+[m
[32m+[m[32m+- (UIStatusBarStyle)preferredStatusBarStyle[m
[32m+[m[32m+{[m
[32m+[m[32m+ return self.statusBarStyle;[m
[32m+[m[32m+}[m
[32m+[m[32m+[m
[32m+[m[32m - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures[m
[32m+[m[32m {[m
[32m+[m[32m if (self.homeIndicatorHidden >= 0) {[m
[1mdiff --git a/src/app.c b/src/app.c[m
[1mindex 811ae403..7dae4b2f 100644[m
[1m--- a/src/app.c[m
[1m+++ b/src/app.c[m
[36m@@ -1856,12 +1856,15 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m
break;[m
}[m
case SDL_DROPFILE: {[m
[31m- if (!d->window) {[m
[32m+[m[32m if (isDesktop_Platform() && !d->window) {[m
/* Need to open an empty window now. */[m
handleNonWindowRelatedCommand_App_(d, "window.new url:");[m
[31m- iAssert(d->window);[m
[32m+[m[32m iAssert(d->window != NULL);[m
[32m+[m[32m }[m
[32m+[m[32m iBool wasUsed = iFalse;[m
[32m+[m[32m if (d->window) {[m
[32m+[m[32m wasUsed = processEvent_Window(as_Window(d->window), &ev);[m
}[m
[31m- iBool wasUsed = processEvent_Window(as_Window(d->window), &ev);[m
if (!wasUsed) {[m
if (startsWithCase_CStr(ev.drop.file, "gemini:") ||[m
startsWithCase_CStr(ev.drop.file, "gopher:") ||[m
[36m@@ -1874,6 +1877,7 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m
"~open newtab:1 url:%s", makeFileUrl_CStr(ev.drop.file));[m
}[m
}[m
[32m+[m[32m SDL_free(ev.drop.file);[m
break;[m
}[m
default: {[m
[1mdiff --git a/src/ios.m b/src/ios.m[m
[1mindex 3140ecb7..690aadbc 100644[m
[1m--- a/src/ios.m[m
[1m+++ b/src/ios.m[m
[36m@@ -583,6 +583,20 @@[m [mstatic void callVoidMethod(id target, NSString *selectorName) {[m
}[m
}[m
[m
[32m+[m[32mstatic NSString *callStringMethod(id target, NSString *selectorName) {[m
[32m+[m[32m SEL sel = NSSelectorFromString(selectorName);[m
[32m+[m[32m if ([target respondsToSelector:sel]) {[m
[32m+[m[32m NSInvocation *call = [NSInvocation invocationWithMethodSignature:[m
[32m+[m[32m [NSMethodSignature signatureWithObjCTypes:"@@:"]];[m
[32m+[m[32m [call setSelector:sel];[m
[32m+[m[32m [call invokeWithTarget:target];[m
[32m+[m[32m NSString *retVal;[m
[32m+[m[32m [call getReturnValue:&retVal];[m
[32m+[m[32m return retVal;[m
[32m+[m[32m }[m
[32m+[m[32m return NULL;[m
[32m+[m[32m}[m
[32m+[m
static void callVoidMethodWithIntArgument(id target, NSString *selectorName, int argValue) {[m
SEL sel = NSSelectorFromString(selectorName);[m
if ([target respondsToSelector:sel]) {[m
[36m@@ -615,9 +629,21 @@[m [miBool processEvent_iOS(const SDL_Event *ev) {[m
}[m
else if (ev->type == SDL_USEREVENT && ev->user.code == command_UserEventCode) {[m
const char *cmd = command_UserEvent(ev);[m
[32m+[m[32m //NSLog(@"%s", cmd);[m
if (equal_Command(cmd, "window.unfreeze")) {[m
id<UIApplicationDelegate> dlg = [UIApplication sharedApplication].delegate;[m
[31m- callVoidMethod([UIApplication sharedApplication].delegate, @"hideLaunchScreen");[m
[32m+[m[32m callVoidMethod(dlg, @"hideLaunchScreen");[m
[32m+[m[32m /* When the application is launching, it is too early to post a SDL_DROPFILE[m
[32m+[m[32m event. The customized SDL application delegate saves the launch URL, so[m
[32m+[m[32m we can use it now to */[m
[32m+[m[32m static iBool didCheckLaunchURL = iFalse;[m
[32m+[m[32m if (!didCheckLaunchURL) {[m
[32m+[m[32m didCheckLaunchURL = iTrue;[m
[32m+[m[32m NSString *launchURL = callStringMethod(dlg, @"getLaunchOptionsURL");[m
[32m+[m[32m if (launchURL) {[m
[32m+[m[32m postCommandf_App("open newtab:1 url:%s", [launchURL UTF8String]);[m
[32m+[m[32m }[m
[32m+[m[32m }[m
}[m
else if (equal_Command(cmd, "ostheme")) {[m
if (arg_Command(cmd)) {[m
text/plain
This content has been proxied by September (ba2dc).