diff options
author | Akemi <der.richter@gmx.de> | 2017-04-02 21:02:00 +0200 |
---|---|---|
committer | Akemi <der.richter@gmx.de> | 2017-04-02 21:02:33 +0200 |
commit | 13160530f2ef05b24dc9331fe42b00def1e4d071 (patch) | |
tree | 11f6fdf0f54e06c3fc132178c77d922916a04981 /osdep | |
parent | d4c1ddd6b166ff2d883a9d2b80c11f9cbf028226 (diff) | |
download | mpv-13160530f2ef05b24dc9331fe42b00def1e4d071.tar.bz2 mpv-13160530f2ef05b24dc9331fe42b00def1e4d071.tar.xz |
osx: fix Touch Bar access on systems without Touch Bar support
when building with a deployment target older than an SDK with Touch Bar
support we still tried to access the TouchBar, since the compile time
checks are positive. to prevent this we add two runtime checks.
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/macosx_application.m | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index fb3d742ed8..52dacb098a 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -135,7 +135,8 @@ static void terminate_cocoa_application(void) - (void)processEvent:(struct mpv_event *)event { #if HAVE_MACOS_TOUCHBAR - [(TouchBar *)self.touchBar processEvent:event]; + if ([self respondsToSelector:@selector(touchBar)]) + [(TouchBar *)self.touchBar processEvent:event]; #endif } @@ -179,9 +180,11 @@ static void terminate_cocoa_application(void) _R(menu, @"Zoom", @"z", MPM_ZOOM) #if HAVE_MACOS_TOUCHBAR - [menu addItem:[NSMenuItem separatorItem]]; - [self menuItemWithParent:menu title:@"Customize Touch Bar…" - action:@selector(toggleTouchBarMenu) keyEquivalent: @""]; + if ([self respondsToSelector:@selector(touchBar)]) { + [menu addItem:[NSMenuItem separatorItem]]; + [self menuItemWithParent:menu title:@"Customize Touch Bar…" + action:@selector(toggleTouchBarMenu) keyEquivalent: @""]; + } #endif return [menu autorelease]; |