From 49b6fa877938e9f53ca905467975ef580d3a4ab2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 17 Oct 2014 17:07:01 +0200 Subject: cocoa: allow to disable apple remote at compile time Actually doesn't remove the related flags so that one can still pass the option with the option doing nothing. --- osdep/macosx_events.m | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'osdep') diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index f913b5db1a..7d0302114b 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -35,12 +35,16 @@ #include "osdep/macosx_compat.h" #import "osdep/macosx_events_objc.h" +#include "config.h" + @interface EventsResponder () { struct input_ctx *_inputContext; NSCondition *_input_ready; CFMachPortRef _mk_tap_port; +#if HAVE_APPLE_REMOTE HIDRemote *_remote; +#endif } - (BOOL)handleMediaKey:(NSEvent *)event; @@ -270,6 +274,8 @@ void cocoa_set_input_context(struct input_ctx *input_context) - (void)startAppleRemote { + +#if HAVE_APPLE_REMOTE dispatch_async(dispatch_get_main_queue(), ^{ self->_remote = [[HIDRemote alloc] init]; if (self->_remote) { @@ -277,14 +283,17 @@ void cocoa_set_input_context(struct input_ctx *input_context) [self->_remote startRemoteControl:kHIDRemoteModeExclusiveAuto]; } }); +#endif } - (void)stopAppleRemote { +#if HAVE_APPLE_REMOTE dispatch_async(dispatch_get_main_queue(), ^{ [self->_remote stopRemoteControl]; [self->_remote release]; }); +#endif } - (void)restartMediaKeys { -- cgit v1.2.3