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.
This commit is contained in:
Dudemanguy 2020-04-23 14:49:18 -05:00
parent 8e50430eaa
commit ca531b1cb2
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}
}