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

Edward Wang edward.c.wang at compdigitec.com
Mon Jan 30 00:34:48 CET 2012


On 12-01-03 11:56 AM, Laurent Aimar wrote:
> 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.
>
Hi Laurent Aimar:

Could you please show me the correct way to do this then? I think that 
this is a great feature to have and it would be nice to be able to 
implement this in VLC.

Thanks,
     Edward Wang



More information about the vlc-devel mailing list