Commit 1fe559b7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: wait until the app finished launching to init SPMediaKeyTap

parent e6978351
...@@ -547,16 +547,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -547,16 +547,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_remote setClickCountEnabledButtons: kRemoteButtonPlay]; [o_remote setClickCountEnabledButtons: kRemoteButtonPlay];
[o_remote setDelegate: _o_sharedMainInstance]; [o_remote setDelegate: _o_sharedMainInstance];
/* init media key support */
o_mediaKeyController = [[SPMediaKeyTap alloc] initWithDelegate:self];
b_mediaKeySupport = config_GetInt( VLCIntf, "macosx-mediakeys" );
[o_mediaKeyController startWatchingMediaKeys];
[o_mediaKeyController setShouldInterceptMediaKeyEvents:b_mediaKeySupport];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(coreChangedMediaKeySupportSetting:) name: @"VLCMediaKeySupportSettingChanged" object: nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
[SPMediaKeyTap defaultMediaKeyUserBundleIdentifiers], kMediaKeyUsingBundleIdentifiersDefaultsKey,
nil]];
/* yeah, we are done */ /* yeah, we are done */
nib_main_loaded = TRUE; nib_main_loaded = TRUE;
} }
...@@ -583,6 +573,16 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -583,6 +573,16 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
if( !p_intf ) return; if( !p_intf ) return;
/* init media key support */
o_mediaKeyController = [[SPMediaKeyTap alloc] initWithDelegate:self];
b_mediaKeySupport = config_GetInt( VLCIntf, "macosx-mediakeys" );
[o_mediaKeyController startWatchingMediaKeys];
[o_mediaKeyController setShouldInterceptMediaKeyEvents:b_mediaKeySupport];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(coreChangedMediaKeySupportSetting:) name: @"VLCMediaKeySupportSettingChanged" object: nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
[SPMediaKeyTap defaultMediaKeyUserBundleIdentifiers], kMediaKeyUsingBundleIdentifiersDefaultsKey,
nil]];
[self _removeOldPreferences]; [self _removeOldPreferences];
/* Handle sleep notification */ /* Handle sleep notification */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment