SDL: Move handleURLEvent setEventHandler to init

From 0052339b6694df5af17d1e25c44cdc4930f5a992 Mon Sep 17 00:00:00 2001
From: Jay <[EMAIL REDACTED]>
Date: Sat, 20 Feb 2021 19:53:44 +0000
Subject: [PATCH] Move handleURLEvent setEventHandler to init

---
 src/video/cocoa/SDL_cocoaevents.m | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m
index b546ddc8e..9d9f6d117 100644
--- a/src/video/cocoa/SDL_cocoaevents.m
+++ b/src/video/cocoa/SDL_cocoaevents.m
@@ -145,6 +145,12 @@ - (id)init
                    selector:@selector(localeDidChange:)
                        name:NSCurrentLocaleDidChangeNotification
                      object:nil];
+
+        [[NSAppleEventManager sharedAppleEventManager]
+            setEventHandler:self
+                andSelector:@selector(handleURLEvent:withReplyEvent:)
+            forEventClass:kInternetEventClass
+                andEventID:kAEGetURL];
     }
 
     return self;
@@ -262,12 +268,6 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
         [NSApp activateIgnoringOtherApps:YES];
     }
 
-    [[NSAppleEventManager sharedAppleEventManager]
-    setEventHandler:self
-        andSelector:@selector(handleURLEvent:withReplyEvent:)
-      forEventClass:kInternetEventClass
-         andEventID:kAEGetURL];
-
     /* If we call this before NSApp activation, macOS might print a complaint
      * about ApplePersistenceIgnoreState. */
     [SDLApplication registerUserDefaults];