[vlc-commits] vout:win32: do not use a display module with a dummy vout_window_t

Steve Lhomme git at videolan.org
Thu Apr 4 12:30:45 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Apr  2 15:23:10 2019 +0200| [0b8b4b7d7e5bd5a6213fbc67f5e305d015cb2f50] | committer: Steve Lhomme

vout:win32: do not use a display module with a dummy vout_window_t

Now that we have a proper Win32 vout_window_t there's no reason to allow a
dummy one and handle a window in the display module.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b8b4b7d7e5bd5a6213fbc67f5e305d015cb2f50
---

 modules/video_output/win32/events.c | 46 ++++++++++++-------------------------
 1 file changed, 15 insertions(+), 31 deletions(-)

diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index f55d8a6ef7..86ae85d121 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -327,13 +327,6 @@ static void *EventThread( void *p_this )
 
     } /* End Main loop */
 
-    /* Check for WM_QUIT if we created the window */
-    if( !p_event->hparent && msg.message == WM_QUIT )
-    {
-        msg_Warn( p_event->obj, "WM_QUIT... should not happen!!" );
-        p_event->hwnd = NULL; /* Window already destroyed */
-    }
-
     msg_Dbg( p_event->obj, "Win32 Vout EventThread terminating" );
 
     Win32VoutCloseWindow( p_event );
@@ -356,8 +349,7 @@ bool EventThreadGetAndResetSizeChanged( event_thread_t *p_event )
 
 event_thread_t *EventThreadCreate( vlc_object_t *obj, vout_window_t *parent_window)
 {
-    if (parent_window->type != VOUT_WINDOW_TYPE_HWND &&
-        !(parent_window->type == VOUT_WINDOW_TYPE_DUMMY && parent_window->handle.hwnd == 0))
+    if (parent_window->type != VOUT_WINDOW_TYPE_HWND)
         return NULL;
      /* Create the Vout EventThread, this thread is created by us to isolate
      * the Win32 PeekMessage function calls. We want to do this because
@@ -636,10 +628,8 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
     hInstance = GetModuleHandle(NULL);
 
     /* If an external window was specified, we'll draw in it. */
-    if ( p_event->parent_window->type == VOUT_WINDOW_TYPE_HWND )
-        p_event->hparent = p_event->parent_window->handle.hwnd;
-    else
-        p_event->hparent = NULL;
+    assert( p_event->parent_window->type == VOUT_WINDOW_TYPE_HWND );
+    p_event->hparent = p_event->parent_window->handle.hwnd;
     p_event->cursor_arrow = LoadCursor(NULL, IDC_ARROW);
     p_event->cursor_empty = EmptyCursor(hInstance);
 
@@ -666,16 +656,13 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
         return VLC_EGENERIC;
     }
 
-    if( p_event->hparent )
-    {
-        i_style = WS_VISIBLE|WS_CLIPCHILDREN|WS_CHILD;
+    i_style = WS_VISIBLE|WS_CLIPCHILDREN|WS_CHILD;
 
-        /* allow user to regain control over input events if requested */
-        bool b_mouse_support = var_InheritBool( p_event->obj, "mouse-events" );
-        bool b_key_support = var_InheritBool( p_event->obj, "keyboard-events" );
-        if( !b_mouse_support && !b_key_support )
-            i_style |= WS_DISABLED;
-    }
+    /* allow user to regain control over input events if requested */
+    bool b_mouse_support = var_InheritBool( p_event->obj, "mouse-events" );
+    bool b_key_support = var_InheritBool( p_event->obj, "keyboard-events" );
+    if( !b_mouse_support && !b_key_support )
+        i_style |= WS_DISABLED;
 
     /* Create the window */
     p_event->hwnd =
@@ -698,15 +685,12 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
         return VLC_EGENERIC;
     }
 
-    if( p_event->hparent )
-    {
-        /* We don't want the window owner to overwrite our client area */
-        LONG  parent_style = GetWindowLong( p_event->hparent, GWL_STYLE );
-        if( !(parent_style & WS_CLIPCHILDREN) )
-            /* Hmmm, apparently this is a blocking call... */
-            SetWindowLong( p_event->hparent, GWL_STYLE,
-                           parent_style | WS_CLIPCHILDREN );
-    }
+    /* We don't want the window owner to overwrite our client area */
+    LONG  parent_style = GetWindowLong( p_event->hparent, GWL_STYLE );
+    if( !(parent_style & WS_CLIPCHILDREN) )
+        /* Hmmm, apparently this is a blocking call... */
+        SetWindowLong( p_event->hparent, GWL_STYLE,
+                       parent_style | WS_CLIPCHILDREN );
 
     int err = CreateVideoWindow( p_event );
     if ( err != VLC_SUCCESS )



More information about the vlc-commits mailing list