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
...@@ -67,6 +67,10 @@ void E_(CloseVideoGL) ( vlc_object_t * ); ...@@ -67,6 +67,10 @@ void E_(CloseVideoGL) ( vlc_object_t * );
"necessary in order to fill the screen without black " \ "necessary in order to fill the screen without black " \
"borders (OpenGL only)." ) "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(); vlc_module_begin();
set_description( _("Mac OS X interface") ); set_description( _("Mac OS X interface") );
set_capability( "interface", 100 ); set_capability( "interface", 100 );
...@@ -87,6 +91,8 @@ vlc_module_begin(); ...@@ -87,6 +91,8 @@ vlc_module_begin();
OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_TRUE ); OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_TRUE );
add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT, add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT,
VLC_TRUE ); VLC_TRUE );
add_bool( "macosx-background", 0, NULL, BACKGROUND_TEXT, BACKGROUND_LONGTEXT,
VLC_FALSE );
add_submodule(); add_submodule();
set_description( "Mac OS X OpenGL" ); set_description( "Mac OS X OpenGL" );
set_capability( "opengl provider", 100 ); set_capability( "opengl provider", 100 );
......
...@@ -144,6 +144,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -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-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", 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-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 */ /* 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 ) 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, ...@@ -234,6 +235,19 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
NULL, NULL, fullScreenAllowEvents ); 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 else
{ {
unsigned int i_stylemask = NSTitledWindowMask | 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