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

Laurent Aimar fenrir at elivagar.org
Tue Jan 3 17:56:20 CET 2012


Hi,

On Tue, Dec 27, 2011 at 09:30:52PM -0500, 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.
> Fixes #4689 if committed.
> Thanks,
> 	Edward Wang
> 
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index a8e4e24..322c9f8 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1193,6 +1193,11 @@ 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 */
> +    bool is_on_top = var_GetBool( vout, "video-on-top" );
> +    vout_SetWindowState(vout->p->display.vd, (!is_paused && is_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;
 This will not correctly work with ThreadChangeOnTop(). Also, I think that
reading video-on-top will probably lead to race condition.

-- 
fenrir



More information about the vlc-devel mailing list