[vlc-devel] [PATCH 1/2] RFC vout:win32: do not use a display module with a dummy vout_window_t

Rémi Denis-Courmont remi at remlab.net
Tue Apr 2 17:46:16 CEST 2019


Le tiistaina 2. huhtikuuta 2019, 17.37.55 EEST Steve Lhomme a écrit :
> 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.
> ---
>  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 6611951b4e..98920290e3 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);
> 
> @@ -670,16 +660,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;

AFAIU Win32 GUI, input events should be forwarded to the parent window in this 
case. Then there should be no needs to care about those settings here.

Though that would probably belong in a separate patch anyway.

LGTM.

-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list