changeset 36168:158f98b5f55a

Avoid duplicating the mouse button handling.
author reimar
date Thu, 09 May 2013 14:06:19 +0000
parents 29fb09ef97b9
children 438586240590
files libvo/x11_common.c
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/x11_common.c	Thu May 09 14:06:18 2013 +0000
+++ b/libvo/x11_common.c	Thu May 09 14:06:19 2013 +0000
@@ -828,6 +828,7 @@
 
 static int handle_x11_event(Display *mydisplay, XEvent *event)
 {
+    int key = 0;
     uint8_t buf[16] = {0};
     KeySym keySym;
     static XComposeStatus stat;
@@ -892,15 +893,7 @@
 
                 return VO_EVENT_MOUSE;
             case ButtonPress:
-#ifdef CONFIG_GUI
-                // Ignore mouse button 1-3 under GUI.
-                if (use_gui && (event->xbutton.button >= 1)
-                    && (event->xbutton.button <= 3))
-                    return VO_EVENT_MOUSE;
-#endif
-                mplayer_put_key((MOUSE_BTN0 + event->xbutton.button -
-                                 1) | MP_KEY_DOWN);
-                return VO_EVENT_MOUSE;
+                key = MP_KEY_DOWN;
             case ButtonRelease:
 #ifdef CONFIG_GUI
                 // Ignore mouse button 1-3 under GUI.
@@ -908,7 +901,8 @@
                     && (event->xbutton.button <= 3))
                     return VO_EVENT_MOUSE;
 #endif
-                mplayer_put_key(MOUSE_BTN0 + event->xbutton.button - 1);
+                key |= MOUSE_BTN0 + event->xbutton.button - 1;
+                mplayer_put_key(key);
                 return VO_EVENT_MOUSE;
             case PropertyNotify:
                 {