[MPlayer-dev-eng] [PATCH] double click to switch to full screen in GUI

laurent wozniak laurent.wozniak at laposte.net
Sat Sep 9 19:48:41 CEST 2006


Hello,

Diego Biurrun wrote:
> Handling double click in a general way and not just with directx would
> be a desirable feature...
>   
I'm sending a patch that contains a completely reworked double click 
event handling.
It is now generic and configurable.

It took me a while, especially due to problems with my connection to 
Internet:
My ISP is considering SVN packets as P2P and they are blocked most of 
the time. And of course, they do not manage to block P2P (now encrypted) ...

Here is an overview of what's included in the patch:

Feature added:
- Added a put key event translation layer.
- Added mouse double click event generation for video drivers supporting 
the mouse press and release events (x11 based and sdl).
- Added configuration: LMB double click switch to full screen.

Corrected bugs:
- Mouse button events were not handled in the gui output window when not 
playing a movie.
- Only the firsts 3 mouse buttons were handled in x11 common video ouput 
driver, others ignored.
- Simulated mouse wheel events (with wheel up/down mouse buttons) were 
interpreted twice.
- Unbound key was blocking next key if sent nearly simultaneously (wheel 
up/down mouse buttons again) in command processing.

More details:

I've removed some specific mouse button handling (wheel mouse) from x11 
and sdl drivers and let the next layer do the job instead.
This layer translate some low level events into higher level events 
(mouse wheel, double click).
The rule is: if a vo driver has access to high level events, it should 
send them. Else, it is handled by the next layer.
Examples:
- A double click event requires a timeout that may be know only by the 
low level layer (the direct x case).
- With x11 drivers and gtk gui, I can retrieve the timeout and let the 
translation layer do the job.
- With x11 drivers and no gui, the timeout is hard-coded.
Also, I'm trying to remove the interpreting of a mouse event partially 
in the gui loop and partially in the vo driver loop since this coupling 
is hard to maintain and has introduced bugs.
So, it should be done either in the gui or in the vo driver loop.
And the gui can notify the translation layer that an event has occurred 
but its corresponding action is vetoed.
For example: The first click is seen but it don't trigger an action 
outside the gui loop. The second click leads to a double click and 
triggers the action.

TO DO:
- merge mouse handlers of "mw.c" and "pb.c" if possible, and add the 
call to the event translation layer in the resulting handler.
- handle more mouse buttons (mine, a gamer one, has 12).

Cheers,
Laurent

-------------- next part --------------
A non-text attachment was scrubbed...
Name: double_click.diff
Type: text/x-patch
Size: 13132 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060909/7f2409c1/attachment.bin>


More information about the MPlayer-dev-eng mailing list