[vlc-devel] Mouse hiding
Rémi Denis-Courmont
remi at remlab.net
Tue Aug 8 17:31:35 CEST 2017
Le tiistaina 8. elokuuta 2017, 11.38.59 EEST Steve Lhomme a écrit :
> On Mon, Aug 7, 2017 at 5:20 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> > I believe that it is meant to be either the window or the display, but not
> > both. Indeed, I can´t really imagine how the responsibility could
> > functionally be shared.
> >
> >> I suppose that's why VOUT_DISPLAY_HIDE_MOUSE is deprecated ?
> >
> > As of last week, I think that both VOUT_DISPLAY_HIDE_MOUSE and
> > VOUT_WINDOW_HIDE_MOUSE should be deprecated. The component tracking mouse
> > movement is in better position to run the hiding timer than the video
> > output core thread.
>
> Well, IMO VOUT_DISPLAY_HIDE_MOUSE is broken by design. To
> enable/disable the mouse the core has its own variable/timer and a
> flag to do the switch when necessary. But with only a HIDE message,
> it's left to interpretation when it should be shown again.
It is definitely asymetric, which is ugly design. Still I don´t think you can
call it broken by design. The cursor is automatically shown when a movement or
click event is received. It´s worked fine since Laurent reworked
the video output. (And I don´t recall how it was done before that.)
> And that will be inconsistent with the state of the core.
AFAIU, the core assumes that the mouse is shown when a mouse event occurs,
i.e. click or movement.
> So either we fix the design or we remove it.
I am not sure what fixing would entail. I agree that it should be removed.
> The problem on Windows is that the vout creates its own window (HWND)
> with it's own mouse cursor.
As far as I know, that is more the result of inaction and organic evolution
than a deliberate design decision. Laurent either did not dare or care to
split the Windows video output plugins, nor did I, and nobody else looked at
the display/window split much until recently. By comparison, X11 outputs
support for non-windowed mode has been dropped years ago. Wayland has never
even had such support.
> I don't see a way to inherit the mouse from the parent.
I think inheritance has to work one way or another, or this is screwed. I
cannot imagine how else a LibVLC application can handle mouse events while
embedding video, i.e. libvlc_set_mouse_input(..., 0).
> So it has to manage it by itself. But it never does since Qt only gets the
> order to hide/show the mouse.
It is always possible for either display or window to handle cursor hiding by
itself. Just hide the cursor after a custom timeout, and show it again when
there is an input event. Meanwhile, ignore VOUT_whatever_HIDE_MOUSE requests
completely.
That´s what I´m planning to do for X11 and Wayland anyway, as it avoids a
useless roundtrip to the vout thread, thus reducing latency and complexity. It
also removes one wake-up source from the video output thread, making one small
step toward tick-less video output.
> If I return an error in Qt (we know for Win32 it has no effect) we fall back
> on the VOUT_DISPLAY_HIDE_MOUSE mechanism. Except it's not compatible with
> the way the core works (ie it decides when to show and hide).
I don´t understand. Why can´t you show the cursor upon movement or click, and
hide it when you get the VOUT_DISPLAY_HIDE_MOUSE control request?
--
雷米‧德尼-库尔蒙
https://www.remlab.net/
More information about the vlc-devel
mailing list