[vlc-devel] [vlc-commits] commit: Fixed mouse buttons state for msw vouts (close #3519). ( Laurent Aimar )

brezhoneg1 brezhoneg1 at yahoo.fr
Sun Jun 13 10:36:56 CEST 2010


Hi,

>
>   [vlc-commits] commit: Fixed mouse buttons state for msw vouts (close
>   #3519). ( Laurent Aimar )
>
> *git at videolan.org* git at videolan.org 
> <mailto:vlc-commits%40videolan.org?Subject=Re%3A%20%5Bvlc-commits%5D%20commit%3A%20Fixed%20mouse%20buttons%20state%20for%20msw%20vouts%0A%09%28close%20%233519%29.%20%28%20Laurent%20Aimar%20%29&In-Reply-To=%3C20100612231415.112EEF42D1%40albiero.videolan.org%3E>
> /Sun Jun 13 01:14:14 CEST 2010/
>
>     * Previous message: [vlc-commits] commit: Qt: try to fix hangout
>       on win32 (Jean-Baptiste Kempf )
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/002021.html>
>     * Next message: [vlc-commits] commit: Fixed potential unaligned
>       access in vaapi/dxva2 picture copy. ( Laurent Aimar )
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/002023.html>
>     * *Messages sorted by:* [ date ]
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/date.html#2022>
>       [ thread ]
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/thread.html#2022>
>       [ subject ]
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/subject.html#2022>
>       [ author ]
>       <http://mailman.videolan.org/pipermail/vlc-commits/2010-June/author.html#2022>
>
>
> ------------------------------------------------------------------------
> vlc/vlc-1.1 | branch: master | Laurent Aimar<fenrir at videolan.org  <http://mailman.videolan.org/listinfo/vlc-commits>>  | Sun Jun 13 00:44:31 2010 +0200| [0e9bb2b6027e3327cf00694cfef5aaa76f446602] | committer: Jean-Baptiste Kempf
>
> Fixed mouse buttons state for msw vouts (close #3519).
>
> Used SetCapture/ReleaseCapture to emulate what x11 seems to do by default.
> (cherry picked from commit 2a1f2f0bf5f14963417fb758910db478ac407a62)
>    

    These mouse input quirks are most probably due to the GUI being 
managed by mainly two (even three) different threads
            - the main GUI thread (qt4)  (owner of the parent windows)
            - the background thread (msw) (owner of the hwnd and 
hvideownd subwindows)
            - the vout thread (some windows interaction via 
vout_display_Control)

    Mouse input is a part of the win32 api that is subject to a set of 
warnings/limitations in a multiple thread (multiple event loops) 
environment (cf msdn doc)

    In addition, multiple threads prevent libvlc developers from easily 
(and legitimately) accessing mouse events when the mouse is over the video.
    (the only solution is based global hooks, that are not really 
straightforward)

    Imho, a clean solution would be to merge the two main threads (qt4 
and msw) in a single one, i.e one single event loop, that just 
dispatches messages to their right window procedures. The third thread 
is less of a problem, but still part of the equation (beware of blocking 
calls)

    I do have a patch that does the following :

     - extend vout_window_t  to request the vout window provider (qt4, 
skins2, libvlc dev thread, ...) thread to execute the code that is 
currently executed by the msw thread (basically, subwindows creation and 
configuration)
     - Since there is now only one single event loop, move message 
management in Windows Procs.

   This patch works satisfactorily. It just needs to be updated with 
latest vlc1.2 changes in msw. If this approach is deemed worth, I can 
update it and send it on this ml for review.

Rgds
Erwan10


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100613/78b89a3a/attachment.html>


More information about the vlc-devel mailing list