Commit 935a2e8d authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx: no window decoration patch by Marius Kjeldahl...

* modules/video_output/directx: no window decoration patch by Marius Kjeldahl (marius at kjeldahl dot net) + modifications by me.
parent 703ed7fc
......@@ -600,9 +600,7 @@ static int Manage( vout_thread_t *p_vout )
else
{
/* Change window style, no borders and no title bar */
int i_style = WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW |
WS_SIZEBOX | WS_VISIBLE;
SetWindowLong( hwnd, GWL_STYLE, i_style );
SetWindowLong( hwnd, GWL_STYLE, p_vout->p_sys->i_window_style );
/* Normal window */
window_placement.showCmd = SW_SHOWNORMAL;
......
......@@ -361,7 +361,7 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
WNDCLASS wc; /* window class components */
HICON vlc_icon = NULL;
char vlc_path[MAX_PATH+1];
int i_style;
int i_style, i_stylex;
msg_Dbg( p_vout, "DirectXCreateWindow" );
......@@ -438,18 +438,34 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
rect_window.left = 10;
rect_window.right = rect_window.left + p_vout->p_sys->i_window_width;
rect_window.bottom = rect_window.top + p_vout->p_sys->i_window_height;
AdjustWindowRect( &rect_window, WS_OVERLAPPEDWINDOW|WS_SIZEBOX, 0 );
i_style = WS_OVERLAPPEDWINDOW|WS_SIZEBOX|WS_VISIBLE|WS_CLIPCHILDREN;
if( var_GetBool( p_vout, "video-deco" ) )
{
/* Open with window decoration */
AdjustWindowRect( &rect_window, WS_OVERLAPPEDWINDOW|WS_SIZEBOX, 0 );
i_style = WS_OVERLAPPEDWINDOW|WS_SIZEBOX|WS_VISIBLE|WS_CLIPCHILDREN;
i_stylex = 0;
}
else
{
/* No window decoration */
AdjustWindowRect( &rect_window, WS_POPUP, 0 );
i_style = WS_POPUP|WS_VISIBLE|WS_CLIPCHILDREN;
i_stylex = 0; // WS_EX_TOOLWINDOW; Is TOOLWINDOW really needed ?
// It messes up the fullscreen window.
}
if( p_vout->p_sys->hparent )
{
i_style = WS_VISIBLE|WS_CLIPCHILDREN|WS_CHILD;
i_stylex = 0;
}
p_vout->p_sys->i_window_style = i_style;
/* Create the window */
p_vout->p_sys->hwnd =
CreateWindowEx( WS_EX_NOPARENTNOTIFY,
CreateWindowEx( WS_EX_NOPARENTNOTIFY | i_stylex,
_T("VLC DirectX"), /* name of window class */
_T(VOUT_TITLE) _T(" (DirectX Output)"), /* window title */
i_style, /* window style */
......@@ -881,7 +897,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
rect_window.top = rect_window.left = 0;
rect_window.right = p_vout->i_window_width * f_arg;
rect_window.bottom = p_vout->i_window_height * f_arg;
AdjustWindowRect( &rect_window, WS_OVERLAPPEDWINDOW|WS_SIZEBOX, 0 );
AdjustWindowRect( &rect_window, p_vout->p_sys->i_window_style, 0 );
SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
rect_window.right - rect_window.left,
......
......@@ -360,9 +360,7 @@ static int Manage( vout_thread_t *p_vout )
else
{
/* Change window style, no borders and no title bar */
int i_style = WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW |
WS_SIZEBOX | WS_VISIBLE;
SetWindowLong( hwnd, GWL_STYLE, i_style );
SetWindowLong( hwnd, GWL_STYLE, p_vout->p_sys->i_window_style );
/* Normal window */
window_placement.showCmd = SW_SHOWNORMAL;
......
......@@ -72,6 +72,7 @@ struct vout_sys_t
int i_window_y;
int i_window_width;
int i_window_height;
int i_window_style;
/* Coordinates of src and dest images (used when blitting to display) */
RECT rect_src;
......
......@@ -232,6 +232,11 @@ static char *ppsz_align_descriptions[] =
#define VIDEO_ON_TOP_LONGTEXT N_("Always place the video window on top of " \
"other windows." )
#define VIDEO_DECO_TEXT N_("Window decorations")
#define VIDEO_DECO_LONGTEXT N_( \
"If this option is disabled, VLC will avoid creating window caption, " \
"frames, etc... around the video. Currently only supported on Windows.")
#define FILTER_TEXT N_("Video filter module")
#define FILTER_LONGTEXT N_( \
"This will allow you to add a post-processing filter to enhance the " \
......@@ -880,6 +885,8 @@ vlc_module_begin();
add_bool( "video-on-top", 0, NULL, VIDEO_ON_TOP_TEXT,
VIDEO_ON_TOP_LONGTEXT, VLC_FALSE );
add_bool( "video-deco", 0, NULL, VIDEO_DECO_TEXT,
VIDEO_DECO_LONGTEXT, VLC_TRUE );
add_module( "filter", "video filter", NULL, NULL,
FILTER_TEXT, FILTER_LONGTEXT, VLC_FALSE );
add_string( "aspect-ratio", "", NULL,
......
......@@ -211,6 +211,9 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_vout, "video-on-top", OnTopCallback, NULL );
/* Add a variable to indicate whether we want window decoration or not */
var_Create( p_vout, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* Add a fullscreen variable */
var_Create( p_vout, "fullscreen", VLC_VAR_BOOL );
text.psz_string = _("Fullscreen");
......
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