From ca531b1cb2324d8ebd7c6d2b6747e401989c4e01 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Thu, 23 Apr 2020 14:49:18 -0500 Subject: 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. --- video/out/wayland_common.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/out') 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); } } -- cgit v1.2.3