From 2f65f0e2548f95b3b8ba6620efe6c0e3cb02420b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 May 2014 02:40:00 +0200 Subject: input: allow disabling window dragging with --no-window-dragging Requested in github issue #608. --- input/input.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index b6dc43c79d..6748e5930d 100644 --- a/input/input.c +++ b/input/input.c @@ -127,6 +127,7 @@ struct input_ctx { bool using_alt_gr; bool using_ar; bool using_cocoa_media_keys; + bool win_drag; // Autorepeat stuff short ar_state; @@ -1237,7 +1238,10 @@ bool mp_input_test_mouse_active(struct input_ctx *ictx, int x, int y) bool mp_input_test_dragging(struct input_ctx *ictx, int x, int y) { - return test_mouse(ictx, x, y, MP_INPUT_ALLOW_VO_DRAGGING); + input_lock(ictx); + bool r = !ictx->win_drag || test_mouse(ictx, x, y, MP_INPUT_ALLOW_VO_DRAGGING); + input_unlock(ictx); + return r; } static void bind_dealloc(struct cmd_bind *bind) @@ -1546,6 +1550,8 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif + ictx->win_drag = global->opts->allow_win_drag; + if (input_conf->in_file) { int mode = O_RDONLY; #ifndef __MINGW32__ -- cgit v1.2.3