Commit 2d83cb8b authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added 2 options: 'macosx-pause-minimized' and 'macosx-video-autoresize' (fixes #5861)

parent 08159b75
......@@ -764,8 +764,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (b_dark_interface)
{
[self miniaturize: sender];
if ([[VLCMain sharedInstance] activeVideoPlayback])
[[VLCCoreInteraction sharedInstance] pause];
if (config_GetInt( VLCIntf, "macosx-pause-minimized" ))
{
if ([[VLCMain sharedInstance] activeVideoPlayback])
[[VLCCoreInteraction sharedInstance] pause];
}
}
else
[super performMiniaturize: sender];
......@@ -908,10 +911,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)someWindowWillMiniaturize:(NSNotification *)notification
{
if([notification object] == o_nonembedded_window || [notification object] == self)
if (config_GetInt( VLCIntf, "macosx-pause-minimized" ))
{
if([[VLCMain sharedInstance] activeVideoPlayback])
[[VLCCoreInteraction sharedInstance] pause];
if([notification object] == o_nonembedded_window || [notification object] == self)
{
if([[VLCMain sharedInstance] activeVideoPlayback])
[[VLCCoreInteraction sharedInstance] pause];
}
}
}
......
......@@ -92,6 +92,16 @@ void WindowClose ( vout_window_t * );
#define SAVEVOL_TEXT N_( "Automatically save the volume on exit" )
#define KEEPSIZE_TEXT N_( "Resize interface to the native video size" )
#define KEEPSIZE_LONGTEXT N_( "You have two choices:\n" \
" - The interface will resize to the native video size\n" \
" - The video will fit to the interface size\n " \
"By default, interface resize to the native video size." )
#define PAUSE_MINIMIZED_TEXT N_( "Pause the video playback when minimized" )
#define PAUSE_MINIMIZED_LONGTEXT N_( \
"With this option enabled, the playback will be automatically paused when minimizing the window." )
vlc_module_begin ()
set_description( N_("Mac OS X interface") )
set_capability( "interface", 200 )
......@@ -110,6 +120,8 @@ vlc_module_begin ()
add_obsolete_bool( "macosx-stretch" ) /* since 2.0.0 */
add_obsolete_bool( "macosx-background" ) /* since 2.0.0 */
add_obsolete_bool( "macosx-eq-keep" ) /* since 2.0.0 */
add_bool( "macosx-video-autoresize", true, KEEPSIZE_TEXT, KEEPSIZE_LONGTEXT, false )
add_bool( "macosx-pause-minimized", false, PAUSE_MINIMIZED_TEXT, PAUSE_MINIMIZED_LONGTEXT, false )
add_submodule ()
set_description( "Mac OS X Video Output Provider" )
......
......@@ -102,6 +102,8 @@
IBOutlet id o_intf_last_update_lbl;
IBOutlet id o_intf_enableGrowl_ckb;
IBOutlet id o_intf_nativefullscreen_ckb;
IBOutlet id o_intf_autoresize_ckb;
IBOutlet id o_intf_pauseminimized_ckb;
IBOutlet id o_osd_encoding_pop;
IBOutlet id o_osd_encoding_txt;
......
......@@ -277,6 +277,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
[o_intf_last_update_lbl setStringValue: @""];
[o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
[o_intf_autoresize_ckb setTitle: _NS("Resize interface to the native video size")];
[o_intf_pauseminimized_ckb setTitle: _NS("Pause the video playback when minimized")];
/* Subtitles and OSD */
[o_osd_encoding_txt setStringValue: _NS("Default Encoding")];
......@@ -485,6 +487,8 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[o_intf_style_dark_bcell setState: NO];
[o_intf_style_bright_bcell setState: YES];
}
[self setupButton: o_intf_autoresize_ckb forBoolValue: "macosx-video-autoresize"];
[self setupButton: o_intf_pauseminimized_ckb forBoolValue: "macosx-pause-minimized"];
/******************
* audio settings *
......@@ -818,6 +822,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
config_PutInt( p_intf, "macosx-mediakeys", [o_intf_mediakeys_ckb state] );
config_PutInt( p_intf, "macosx-interfacestyle", [o_intf_style_dark_bcell state] );
config_PutInt( p_intf, "macosx-nativefullscreenmode", [o_intf_nativefullscreen_ckb state] );
config_PutInt( p_intf, "macosx-pause-minimized", [o_intf_pauseminimized_ckb state] );
config_PutInt( p_intf, "macosx-video-autoresize", [o_intf_autoresize_ckb state] );
if( [o_intf_enableGrowl_ckb state] == NSOnState )
{
tmpString = getString( "control" );
......
......@@ -336,6 +336,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
{
if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
{
if (!config_GetInt( vd, "macosx-video-autoresize" ))
return VLC_SUCCESS;
}
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
NSPoint topleftbase;
NSPoint topleftscreen;
......
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