]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/directx: no window decoration patch by Marius Kjeldahl (marius...
authorGildas Bazin <gbazin@videolan.org>
Thu, 2 Dec 2004 11:14:43 +0000 (11:14 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 2 Dec 2004 11:14:43 +0000 (11:14 +0000)
modules/video_output/directx/directx.c
modules/video_output/directx/events.c
modules/video_output/directx/glwin32.c
modules/video_output/directx/vout.h
src/libvlc.h
src/video_output/vout_intf.c

index ec3275238ab6d833dc0669120ae03cfeb5206a18..f3da672886432e1951d57162a8ca07fdd1e33aa2 100644 (file)
@@ -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;
index a844444cafb57faceed4bf31862424435d5caa1d..c704a7e1326a82cbe97bc27cb45c8aa03b2e3a03 100644 (file)
@@ -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,
index 61df44cbcef41084e5ca7f6eed6c8085bd7b0283..9afd698e17b9ec6a9177b6bf0f5670b1c29b07bc 100644 (file)
@@ -360,9 +360,7 @@ static int Manage( vout_thread_t *p_vout )
         else\r
         {\r
             /* Change window style, no borders and no title bar */\r
-            int i_style = WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW |\r
-                WS_SIZEBOX | WS_VISIBLE;\r
-            SetWindowLong( hwnd, GWL_STYLE, i_style );\r
+            SetWindowLong( hwnd, GWL_STYLE, p_vout->p_sys->i_window_style );\r
 \r
             /* Normal window */\r
             window_placement.showCmd = SW_SHOWNORMAL;\r
index 60531807171a9c0c5a19f0c11f6a5d4c940a6f76..6071f0eadd24c84d15a679c428c013149a016864 100644 (file)
@@ -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;
index 027b41f2dd8e6db9357310885e6245e7f041b0fe..6e9c1a99356936ddc2bfc7a581a33f16199ff0aa 100644 (file)
@@ -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,
index 6507c3a909040cbb5932b6793c2e0bee27512835..be3efabcb28400879011aae18c21c0d907041441 100644 (file)
@@ -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");