summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-04-23 14:49:18 -0500
committerDudemanguy <random342@airmail.cc>2020-04-23 14:49:18 -0500
commitca531b1cb2324d8ebd7c6d2b6747e401989c4e01 (patch)
tree5fa55a43f6c69527c5b8fd5e9ff34148f66240bf
parent8e50430eaad3359cdd69c9a0d76e222cfc464db8 (diff)
downloadmpv-ca531b1cb2324d8ebd7c6d2b6747e401989c4e01.tar.bz2
mpv-ca531b1cb2324d8ebd7c6d2b6747e401989c4e01.tar.xz
wayland: explictly send an UP event for left click
In the wayland code, the left mouse click is treated a bit differently. Dragging the left click allows mpv to request a window move to the compositor. In some cases, this can also request a window resize if the osc-windowcontrols are enabled. These functions had the strange side effect of messing up mpv's deadzone (it seemed to disappear completely). A harmless enough workaround is to just explictly send an UP event for left click after the move/resize functions are finished executing. The xdg_toplevel move and resize functions both finish after the button press is let go, so we are guarenteed to have the left click in the UP state here. Sending this event probably unconfuses some calculation somewhere thus fixing the deadzone bug. It feels a little silly, but it's safe and works. Fixes #7651.
-rw-r--r--video/out/wayland_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 70e72b491c..f5adc7a15a 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -244,6 +244,8 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
xdg_toplevel_resize(wl->xdg_toplevel, wl->seat, serial, edges);
else
window_move(wl, serial);
+ // Explictly send an UP event after the client finishes a move/resize
+ mp_input_put_key(wl->vo->input_ctx, button | MP_KEY_STATE_UP);
}
}