[MPlayer-dev-eng] [PATCH] move mousewheel-down event supression to fifo.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jan 18 20:48:18 CET 2007


Hello,
mousewheel down events are supressed because they tend to get stuck
(only space for 10 events in our queue). Instead of having this code
twice in x11_common.c and vo_sdl.c this patch moves it to fifo.c.
That should make both the reason for this "hack" more clear and maybe
make it easier to create a proper solution.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: fifo.c
===================================================================
--- fifo.c	(revision 21959)
+++ fifo.c	(working copy)
@@ -79,6 +79,8 @@
       (code & ~MP_KEY_DOWN) >= MOUSE_BTN0_DBL &&
       (code & ~MP_KEY_DOWN) <= MOUSE_BTN9_DBL)
     return;
+  // ignore mouse wheel down events since they can easily get stuck
+  if (code < (MOUSE_BTN3 | MP_KEY_DOWN) || code > (MOUSE_BTN4 | MP_KEY_DOWN))
   mplayer_put_key_internal(code);
   if (code & MP_KEY_DOWN) {
     code &= ~MP_KEY_DOWN;
Index: libvo/vo_sdl.c
===================================================================
--- libvo/vo_sdl.c	(revision 21959)
+++ libvo/vo_sdl.c	(working copy)
@@ -1190,9 +1190,6 @@
 			case SDL_MOUSEBUTTONDOWN:
 				if(vo_nomouse_input)
 				    break;
-				if(event.button.button == 4 || event.button.button == 5)
-					mplayer_put_key(MOUSE_BTN0+event.button.button-1);
-				else
 					mplayer_put_key((MOUSE_BTN0+event.button.button-1) | MP_KEY_DOWN);
 				break;			    
 		
Index: libvo/x11_common.c
===================================================================
--- libvo/x11_common.c	(revision 21959)
+++ libvo/x11_common.c	(working copy)
@@ -1106,12 +1106,6 @@
                     mouse_waiting_hide = 1;
                     mouse_timer = GetTimerMS();
                 }
-                // Ignore mouse wheel press event.
-                if (Event.xbutton.button > 3)
-                {
-                    mplayer_put_key(MOUSE_BTN0 + Event.xbutton.button - 1);
-                    break;
-                }
 #ifdef HAVE_NEW_GUI
                 // Ignore mouse button 1-3 under GUI.
                 if (use_gui && (Event.xbutton.button >= 1)


More information about the MPlayer-dev-eng mailing list