diff options
Diffstat (limited to 'osdep/mac/app_hub.swift')
-rw-r--r-- | osdep/mac/app_hub.swift | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/osdep/mac/app_hub.swift b/osdep/mac/app_hub.swift index d5b0827be3..a668948603 100644 --- a/osdep/mac/app_hub.swift +++ b/osdep/mac/app_hub.swift @@ -39,8 +39,9 @@ class AppHub: NSObject { } @objc func initMpv(_ mpv: OpaquePointer) { - self.mpv = mpv - event = EventHelper(mpv) + event = EventHelper(self, mpv) + self.mpv = event?.mpv + #if HAVE_MACOS_MEDIA_PLAYER remote?.registerEvents() #endif @@ -54,7 +55,7 @@ class AppHub: NSObject { } @objc func initCocoaCb() { - guard let app = NSApp as? Application else { return } + guard let app = NSApp as? Application, let mpv = mpv else { return } DispatchQueue.main.sync { app.initCocoaCb(mpv) } } |