diff options
author | der richter <der.richter@gmx.de> | 2024-03-24 00:34:04 +0100 |
---|---|---|
committer | der richter <der.richter@gmx.de> | 2024-03-24 23:03:48 +0100 |
commit | f9618ea487d7b017d1a08b8e8d01fc5b63aac245 (patch) | |
tree | e82132b47b1e4b6c45fb2d410575bd30970e9979 | |
parent | 3e6c931d90c065eed6be12e2a1dab863566a7f82 (diff) | |
download | mpv-f9618ea487d7b017d1a08b8e8d01fc5b63aac245.tar.bz2 mpv-f9618ea487d7b017d1a08b8e8d01fc5b63aac245.tar.xz |
mac/touchbar: move touch bar into AppHub
-rw-r--r-- | osdep/mac/app_hub.swift | 6 | ||||
-rw-r--r-- | osdep/mac/application.m | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/osdep/mac/app_hub.swift b/osdep/mac/app_hub.swift index 42577433e0..1b7173e973 100644 --- a/osdep/mac/app_hub.swift +++ b/osdep/mac/app_hub.swift @@ -24,6 +24,9 @@ class AppHub: NSObject { #if HAVE_MACOS_MEDIA_PLAYER var remote: RemoteCommandCenter? #endif +#if HAVE_MACOS_TOUCHBAR + @objc var touchBar: TouchBar? +#endif var isApplication: Bool { get { NSApp is Application } } @@ -45,6 +48,9 @@ class AppHub: NSObject { #if HAVE_MACOS_MEDIA_PLAYER remote?.registerEvents() #endif +#if HAVE_MACOS_TOUCHBAR + touchBar = TouchBar() +#endif } @objc func initInput(_ input: OpaquePointer?) { diff --git a/osdep/mac/application.m b/osdep/mac/application.m index 946c276956..ad4b4c5dca 100644 --- a/osdep/mac/application.m +++ b/osdep/mac/application.m @@ -157,7 +157,7 @@ static const char mac_icon[] = #if HAVE_MACOS_TOUCHBAR - (NSTouchBar *)makeTouchBar { - return [[TouchBar alloc] init]; + return [[AppHub shared] touchBar]; } #endif |