Commit 7f0b0268 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed setting the following options on the command line:...

macosx: fixed setting the following options on the command line: 'macosx-vdev', 'macosx-nativefullscreenmode', 'macosx-background', 'macosx-video-autoresize', 'macosx-black', 'macosx-mediakeys', 'macosx-appleremote'

This also closes #5892.
parent e5d1d745
...@@ -534,7 +534,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -534,7 +534,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mitem setEnabled: YES]; [o_mitem setEnabled: YES];
[o_mitem setTarget: self]; [o_mitem setTarget: self];
} }
[[o_submenu itemWithTag: config_GetInt( VLCIntf, "macosx-vdev" )] setState: NSOnState]; [[o_submenu itemWithTag: var_InheritInteger( VLCIntf, "macosx-vdev" )] setState: NSOnState];
} }
- (void)setSubmenusEnabled:(BOOL)b_enabled - (void)setSubmenusEnabled:(BOOL)b_enabled
......
...@@ -171,7 +171,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -171,7 +171,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
b_nativeFullscreenMode = NO; b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7 #ifdef MAC_OS_X_VERSION_10_7
if( OSX_LION && b_video_deco ) if( OSX_LION && b_video_deco )
b_nativeFullscreenMode = config_GetInt( VLCIntf, "macosx-nativefullscreenmode" ); b_nativeFullscreenMode = var_InheritBool( VLCIntf, "macosx-nativefullscreenmode" );
#endif #endif
t_hide_mouse_timer = nil; t_hide_mouse_timer = nil;
[o_detached_video_window setDelegate: self]; [o_detached_video_window setDelegate: self];
...@@ -1786,10 +1786,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1786,10 +1786,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (id)setupVideoView - (id)setupVideoView
{ {
// TODO: make lion fullscreen compatible with macosx-background and !embedded-video // TODO: make lion fullscreen compatible with macosx-background and !embedded-video
if( config_GetInt( VLCIntf, "macosx-background" ) && !b_nativeFullscreenMode ) if( var_InheritBool( VLCIntf, "macosx-background" ) && !b_nativeFullscreenMode )
{ {
msg_Dbg( VLCIntf, "Creating background window" ); msg_Dbg( VLCIntf, "Creating background window" );
NSScreen *screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)config_GetInt( VLCIntf, "macosx-vdev" )]; NSScreen *screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_InheritInteger( VLCIntf, "macosx-vdev" )];
if( !screen ) if( !screen )
screen = [self screen]; screen = [self screen];
NSRect screen_rect = [screen frame]; NSRect screen_rect = [screen frame];
...@@ -1974,7 +1974,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1974,7 +1974,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
nativeVideoSize = size; nativeVideoSize = size;
if( config_GetInt( VLCIntf, "macosx-video-autoresize" ) && !b_fullscreen && !config_GetInt( VLCIntf, "macosx-background" ) ) if( var_InheritBool( VLCIntf, "macosx-video-autoresize" ) && !b_fullscreen && !var_InheritBool( VLCIntf, "macosx-background" ) )
[self performSelectorOnMainThread:@selector(resizeWindow) withObject:nil waitUntilDone:NO]; [self performSelectorOnMainThread:@selector(resizeWindow) withObject:nil waitUntilDone:NO];
} }
...@@ -2037,10 +2037,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -2037,10 +2037,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
NSScreen *screen; NSScreen *screen;
NSRect screen_rect; NSRect screen_rect;
NSRect rect; NSRect rect;
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" ); BOOL blackout_other_displays = var_InheritBool( VLCIntf, "macosx-black" );
o_current_video_window = [o_video_view window]; o_current_video_window = [o_video_view window];
screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)config_GetInt( VLCIntf, "macosx-vdev" )]; screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_InheritInteger( VLCIntf, "macosx-vdev" )];
[self lockFullscreenAnimation]; [self lockFullscreenAnimation];
if (!screen) if (!screen)
...@@ -2224,7 +2224,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -2224,7 +2224,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
NSMutableDictionary *dict1, *dict2; NSMutableDictionary *dict1, *dict2;
NSRect frame; NSRect frame;
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" ); BOOL blackout_other_displays = var_InheritBool( VLCIntf, "macosx-black" );
if( !o_current_video_window ) if( !o_current_video_window )
return; return;
......
...@@ -625,12 +625,12 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -625,12 +625,12 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_msgs_refresh_btn setImage: [NSImage imageNamed: NSImageNameRefreshTemplate]]; [o_msgs_refresh_btn setImage: [NSImage imageNamed: NSImageNameRefreshTemplate]];
BOOL b_video_deco = config_GetInt( VLCIntf, "video-deco" ); BOOL b_video_deco = var_InheritBool( VLCIntf, "video-deco" );
/* yeah, we are done */ /* yeah, we are done */
b_nativeFullscreenMode = NO; b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7 #ifdef MAC_OS_X_VERSION_10_7
if( OSX_LION && b_video_deco ) if( OSX_LION && b_video_deco )
b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" ); b_nativeFullscreenMode = var_InheritBool( p_intf, "macosx-nativefullscreenmode" );
#endif #endif
/* recover stored audio device, if set /* recover stored audio device, if set
...@@ -669,7 +669,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -669,7 +669,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mainwindow makeKeyAndOrderFront: self]; [o_mainwindow makeKeyAndOrderFront: self];
/* init media key support */ /* init media key support */
b_mediaKeySupport = config_GetInt( VLCIntf, "macosx-mediakeys" ); b_mediaKeySupport = var_InheritBool( VLCIntf, "macosx-mediakeys" );
if( b_mediaKeySupport ) if( b_mediaKeySupport )
{ {
o_mediaKeyController = [[SPMediaKeyTap alloc] initWithDelegate:self]; o_mediaKeyController = [[SPMediaKeyTap alloc] initWithDelegate:self];
...@@ -897,7 +897,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -897,7 +897,7 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)applicationDidBecomeActive:(NSNotification *)aNotification - (void)applicationDidBecomeActive:(NSNotification *)aNotification
{ {
if( !p_intf ) return; if( !p_intf ) return;
if( config_GetInt( p_intf, "macosx-appleremote" ) == YES ) if( var_InheritBool( p_intf, "macosx-appleremote" ) == YES )
[o_remote startListening: self]; [o_remote startListening: self];
} }
- (void)applicationDidResignActive:(NSNotification *)aNotification - (void)applicationDidResignActive:(NSNotification *)aNotification
...@@ -1659,7 +1659,7 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1659,7 +1659,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
- (void)setWindowLevel:(NSNumber*)state - (void)setWindowLevel:(NSNumber*)state
{ {
if( config_GetInt( p_intf, "macosx-background" ) ) if( var_InheritBool( p_intf, "macosx-background" ) )
return; return;
if ([state unsignedIntValue] & VOUT_WINDOW_STATE_ABOVE) if ([state unsignedIntValue] & VOUT_WINDOW_STATE_ABOVE)
...@@ -2179,7 +2179,7 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -2179,7 +2179,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
} }
- (void)coreChangedMediaKeySupportSetting: (NSNotification *)o_notification - (void)coreChangedMediaKeySupportSetting: (NSNotification *)o_notification
{ {
b_mediaKeySupport = config_GetInt( VLCIntf, "macosx-mediakeys" ); b_mediaKeySupport = var_InheritBool( VLCIntf, "macosx-mediakeys" );
if (b_mediaKeySupport) if (b_mediaKeySupport)
{ {
if (!o_mediaKeyController) if (!o_mediaKeyController)
......
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