# HG changeset patch # User reimar # Date 1368108379 0 # Node ID 158f98b5f55a6b38909dcdc85ff306afa2af45e8 # Parent 29fb09ef97b99e009d45cc30d9f463546ae1ee9a Avoid duplicating the mouse button handling. diff -r 29fb09ef97b9 -r 158f98b5f55a libvo/x11_common.c --- 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: {