summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-10 15:57:36 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commitcc2490ea7eb4dc1480bc26d62a3bbb15d387c35b (patch)
tree594273dbfcc150173cd432a693dccf8b4797999f /video/out
parentbe5e46222ba4adccc5a557375beea29d23969a81 (diff)
downloadmpv-cc2490ea7eb4dc1480bc26d62a3bbb15d387c35b.tar.bz2
mpv-cc2490ea7eb4dc1480bc26d62a3bbb15d387c35b.tar.xz
input: add a define for the number of mouse buttons and use it
(Why the fuck are there up to 20 mouse buttons?)
Diffstat (limited to 'video/out')
-rw-r--r--video/out/x11_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 5f2c658a9c..fae53fc93d 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1133,6 +1133,8 @@ void vo_x11_check_events(struct vo *vo)
mp_input_put_key(x11->input_ctx, MP_KEY_MOUSE_ENTER);
break;
case ButtonPress:
+ if (Event.xbutton.button - 1 >= MP_KEY_MOUSE_BTN_COUNT)
+ break;
if (Event.xbutton.button == 1)
x11->win_drag_button1_down = true;
mp_input_put_key(x11->input_ctx,
@@ -1142,6 +1144,8 @@ void vo_x11_check_events(struct vo *vo)
vo_x11_xembed_send_message(x11, msg);
break;
case ButtonRelease:
+ if (Event.xbutton.button - 1 >= MP_KEY_MOUSE_BTN_COUNT)
+ break;
if (Event.xbutton.button == 1)
x11->win_drag_button1_down = false;
mp_input_put_key(x11->input_ctx,