summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-20 02:40:00 +0200
committerwm4 <wm4@nowhere>2014-05-20 02:40:28 +0200
commit2f65f0e2548f95b3b8ba6620efe6c0e3cb02420b (patch)
treebefd281e20fca19e7acdd9be08d2aeef445c23b5 /input
parent15c22fb0eb1e29a5dfc04b07dda958d6c415d5c1 (diff)
downloadmpv-2f65f0e2548f95b3b8ba6620efe6c0e3cb02420b.tar.bz2
mpv-2f65f0e2548f95b3b8ba6620efe6c0e3cb02420b.tar.xz
input: allow disabling window dragging with --no-window-dragging
Requested in github issue #608.
Diffstat (limited to 'input')
-rw-r--r--input/input.c8
1 files changed, 7 insertions, 1 deletions
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__