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

laurent wozniak laurent.wozniak at laposte.net
Tue Oct 3 00:06:22 CEST 2006


Hello,

Reimar Döffinger wrote:
>>  				break;
>>  			int x = GET_WHEEL_DELTA_WPARAM(wParam);
>>  			if (x > 0)
>> -				mplayer_put_key(MOUSE_BTN3);
>> +				mplayer_put_key(MOUSE_WHL_UP);
>>  			else
>> -				mplayer_put_key(MOUSE_BTN4);
>> +				mplayer_put_key(MOUSE_WHL_DOWN);
>>  			break;
>>     
>
> The mouse wheel changes should be discussed separately as well, esp.
> since this new systems is also broken, even if less so than the current
> one.
>
>   
If you remove the above change, you break this one:
>   // Translate mouse wheel: Ignore simulated release event
>   else if (code == MOUSE_BTN3 || code == MOUSE_BTN4) {
>     ignore = 1;
>   }
If you remove also this one, you remove the bug correction:
Simulated wheel mouse events are interpreted twice.

> since this new systems is also broken, even if less so than the current
> one.
>   
I suppose you're talking about this mouse with 2 wheels ?
Or is it another problem ?

By convention, wheel mouse, the 1st, is bound to buttons 3 and 4. But 
there is no convention for a 2nd wheel.
So I don't see how it is possible to distinguish between a button click 
and this 2nd wheel movement.
Could you tell me to which buttons the 2nd wheel is bound to ?
With my mouse default bindings, according to xev, wheel + buttons 
produce the button range [1..11].

>> Index: libvo/x11_common.c
>> ===================================================================
>> --- libvo/x11_common.c	(revision 19814)
>> +++ libvo/x11_common.c	(working copy)
>> @@ -1098,17 +1098,8 @@
>>                      mouse_waiting_hide = 1;
>>                      mouse_timer = GetTimerMS();
>>                  }
>> -                // Ignore mouse whell press event
>> -                if (Event.xbutton.button > 3)
>> -                {
>> -                    mplayer_put_key(MOUSE_BTN0 + Event.xbutton.button - 1);
>> -                    break;
>> -                }
>>  #ifdef HAVE_NEW_GUI
>> -                // Ignor mouse button 1 - 3 under gui 
>> -                if (use_gui && (Event.xbutton.button >= 1)
>> -                    && (Event.xbutton.button <= 3))
>> -                    break;
>> +                if ( use_gui ) { break; }
>>  #endif
>>                  mplayer_put_key((MOUSE_BTN0 + Event.xbutton.button -
>>                                   1) | MP_KEY_DOWN);
>> @@ -1121,10 +1112,7 @@
>>                      mouse_timer = GetTimerMS();
>>                  }
>>  #ifdef HAVE_NEW_GUI
>> -                // Ignor mouse button 1 - 3 under gui 
>> -                if (use_gui && (Event.xbutton.button >= 1)
>> -                    && (Event.xbutton.button <= 3))
>> -                    break;
>> +                if ( use_gui ) { break; }
>>  #endif
>>     
>
> Double-click stuff would probably still work without this stuff, too.
> Mind, I do not say I'm against this, but I don't like do-everything-(and
> in most cases nothing-properly-)patches.
>   
The purpose of this was to factorize code and correct bugs.

I'm sure the previous code was working with a regular 2 buttons and a 
wheel mouse,
but with an advanced mouse such as my MX1000 that was not the case anymore.

Truly, I've started implementing the double click stuff only after 
factorizing code and corrected some bugs.
Trying to make the double click work without that is risky and 
absolutely untested.

I'd like to help, but I don't know what to do now ...

Cheers,
Laurent




More information about the MPlayer-dev-eng mailing list