diff options
author | der richter <der.richter@gmx.de> | 2024-03-24 14:11:13 +0100 |
---|---|---|
committer | der richter <der.richter@gmx.de> | 2024-03-24 23:03:48 +0100 |
commit | a46ce9e28cd97f7280c085649a79f85aa1d0fe70 (patch) | |
tree | 9698fde4159a0cc07bd39aeac58884f430b4f693 /osdep/mac/app_hub.swift | |
parent | b77d5386c3717274ff8fa55fc60ba5db16b485fc (diff) | |
download | mpv-a46ce9e28cd97f7280c085649a79f85aa1d0fe70.tar.bz2 mpv-a46ce9e28cd97f7280c085649a79f85aa1d0fe70.tar.xz |
mac/event: only initialise an EventHelper when necessary
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) } } |