Commit 5c0dd04b authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Option for Desktop Background mode for VLC OSX.

  Does not work on the fly, because that requires recreating the window atm.
parent 89dbad52
......@@ -66,6 +66,10 @@ void E_(CloseVideoGL) ( vlc_object_t * );
#define FILL_LONGTEXT N_("In fullscreen mode, crop the picture if " \
"necessary in order to fill the screen without black " \
"borders (OpenGL only)." )
#define BACKGROUND_TEXT N_("Use as Desktop Background")
#define BACKGROUND_LONGTEXT N_("Use the video as the Desktop Background " \
"of the Finder. Desktop icons cannot be interacted with in this mode." )
vlc_module_begin();
set_description( _("Mac OS X interface") );
......@@ -87,6 +91,8 @@ vlc_module_begin();
OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_TRUE );
add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT,
VLC_TRUE );
add_bool( "macosx-background", 0, NULL, BACKGROUND_TEXT, BACKGROUND_LONGTEXT,
VLC_FALSE );
add_submodule();
set_description( "Mac OS X OpenGL" );
set_capability( "opengl provider", 100 );
......
......@@ -144,6 +144,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
var_Create( p_vout, "macosx-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-opaqueness", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-background", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
if( var_Type( p_real_vout->p_vlc, "video-device" ) == 0 )
......@@ -234,6 +235,19 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
NULL, NULL, fullScreenAllowEvents );
}
}
else if( var_GetBool( p_real_vout, "macosx-background" ) )
{
NSRect screen_rect = [o_screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0;
/* Creates a window with size: screen_rect on o_screen */
[self initWithContentRect: screen_rect
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: YES screen: o_screen];
[self setLevel: CGWindowLevelForKey(kCGDesktopWindowLevelKey)];
}
else
{
unsigned int i_stylemask = NSTitledWindowMask |
......
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