[vlc-devel] [PATCH 10/11] display: always set VOUT_DISPLAY_HIDE_MOUSE if needs_hide_mouse is set

Steve Lhomme robux4 at gmail.com
Wed Aug 9 12:43:55 CEST 2017

On Tue, Aug 8, 2017 at 5:42 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le tiistaina 8. elokuuta 2017, 15.22.30 EEST Steve Lhomme a écrit :
>> That means the vout will handle the mouse hiding on top of the GUI.
>> Fix #17819
>> ---
>>  src/video_output/display.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> diff --git a/src/video_output/display.c b/src/video_output/display.c
>> index 1925e2691d..d85079cf39 100644
>> --- a/src/video_output/display.c
>> +++ b/src/video_output/display.c
>> @@ -756,8 +756,8 @@ bool vout_ManageDisplay(vout_display_t *vd, bool
>> allow_reset_pictures)
>>      if (hide_mouse_changed) {
>>          msg_Dbg(vd, "auto %sing mouse cursor", hide_mouse?"hid":"show");
>> -        if (vout_HideWindowMouse(osys->vout, hide_mouse) != VLC_SUCCESS
>> -         && vd->info.needs_hide_mouse)
>> +        vout_HideWindowMouse(osys->vout, hide_mouse);
>> +        if (vd->info.needs_hide_mouse)
>>              vout_display_Control(vd, VOUT_DISPLAY_HIDE_MOUSE, hide_mouse);
>>      }
> This does not make sense. You can´t have both the display and the window
> controlling the cursor. Normally, the window does all mouse handling. But even

Except when it doesn't. It seems there are plenty of vout that handle
the mouse by themselves. At least for Windows there's a reason for
that, I can't tell for the others. But there's no way for the GUI to
show the mouse over another HWND, even a child one. And therefore if
the core wants the mouse hidden/shown it needs to tell the vout. Or we
assume they are unrelated and the vout deals with the mouse hiding
when it wants to. Duplicating the timeout handling in each vout that
has a cursor handling on top of the GUI. That's especially true if
we're going to remove VOUT_DISPLAY_HIDE_MOUSE. Then the cursor shown
over the vout Windows will be the sole responsibility of the vout.

Is that what we want ?

> if a windowing system decides to do it the other way, i.e. by the display, it
> can´t be done by both.

Given the GUI has no way to tell which vout will be used, there no
reason for it to return an error even if what it does has zero effect.
If anything, the core knows the vout will or will not handle the mouse
and so should decide which one to tell and never both. That's if we
needs to tell if we want to show or hide the cursor.

> The cursor is not quantic. It can´t be in two places, it can´t have two masks
> of pressed buttons and it can´t be both visible and hidden at the same time.
> The core only keeps track of one mouse state.
> --
> 雷米‧德尼-库尔蒙
> https://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list