[vlc-devel] [PATCH] Don't keep VLC on top when paused

Laurent Aimar fenrir at elivagar.org
Wed Mar 14 15:49:10 CET 2012


Hi,

On Sun, Mar 11, 2012 at 08:31:58PM -0400, Edward Wang wrote:
> Have the "always on top" preference only take effect while a movie is playing. When not playing VLC will act like any other window.
> 
> Close #4689
> ---
>  Alternative approach that doesn't require var_GetBool()
> 
>  src/video_output/video_output.c  |    5 +++++
>  src/video_output/vout_internal.h |    2 ++
>  2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index a8e4e24..82528c8 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1193,6 +1193,10 @@ static void ThreadChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
>  {
>      assert(!vout->p->pause.is_on || !is_paused);
>  
> +    /* Only stay on top if not paused */
> +    vout_SetWindowState(vout->p->display.vd, (!is_paused && vout->p->always_on_top) ? VOUT_WINDOW_STATE_ABOVE
> +                                                       : VOUT_WINDOW_STATE_NORMAL );
> +
>      if (vout->p->pause.is_on) {
>          const mtime_t duration = date - vout->p->pause.date;
>  
> @@ -1278,6 +1282,7 @@ static void ThreadChangeOnTop(vout_thread_t *vout, bool is_on_top)
>      vout_SetWindowState(vout->p->display.vd,
>                          is_on_top ? VOUT_WINDOW_STATE_ABOVE :
>                                      VOUT_WINDOW_STATE_NORMAL);
 This one is not in synch with what is done in ThreadChangePause() which
does not seems right to me.
> +    vout->p->always_on_top = is_on_top;
>  }

Now in itself, I dunno if it will please everybody to have that behaviour,
has anyone an opinion on it (pro/con)?

-- 
fenrir



More information about the vlc-devel mailing list