From f9618ea487d7b017d1a08b8e8d01fc5b63aac245 Mon Sep 17 00:00:00 2001 From: der richter Date: Sun, 24 Mar 2024 00:34:04 +0100 Subject: mac/touchbar: move touch bar into AppHub --- osdep/mac/app_hub.swift | 6 ++++++ osdep/mac/application.m | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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 } } @@ -44,6 +47,9 @@ class AppHub: NSObject { event = EventHelper(mpv) #if HAVE_MACOS_MEDIA_PLAYER remote?.registerEvents() +#endif +#if HAVE_MACOS_TOUCHBAR + touchBar = TouchBar() #endif } 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 -- cgit v1.2.3