summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-02-28 14:19:20 -0500
committersfan5 <sfan5@live.de>2024-03-01 18:25:12 +0100
commit34055919f5c7b0843ea4c938b2f0043958864708 (patch)
treea786b6729598b967df53665be15fab6fb0e1dfbf
parentfb02626cd9d975f717a0d74652e5f4d22429d66d (diff)
downloadmpv-34055919f5c7b0843ea4c938b2f0043958864708.tar.bz2
mpv-34055919f5c7b0843ea4c938b2f0043958864708.tar.xz
wayland_common: toplevel resize fixes
Explicitly send an UP event after the client finishes a resize for touch event, don't resize if locked_size is set for touch event, and use the correct type for resize edges.
-rw-r--r--video/out/wayland_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 3b69f60947..c7314cb144 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -306,7 +306,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
if (button)
mp_input_put_key(wl->vo->input_ctx, button | state | s->mpmod);
- uint32_t edges;
+ enum xdg_toplevel_resize_edge edges;
if (!mp_input_test_dragging(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y) &&
!wl->locked_size && (button == MP_MBTN_LEFT) && (state == MP_KEY_STATE_DOWN) &&
!wl->vo_opts->border && check_for_resize(wl, wl->opts->edge_pixels_pointer, &edges))
@@ -429,19 +429,21 @@ static void touch_handle_down(void *data, struct wl_touch *wl_touch,
wl->mouse_x = wl_fixed_to_int(x_w) * wl->scaling;
wl->mouse_y = wl_fixed_to_int(y_w) * wl->scaling;
+ mp_input_set_mouse_pos(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y);
+ mp_input_put_key(wl->vo->input_ctx, MP_MBTN_LEFT | MP_KEY_STATE_DOWN);
+
enum xdg_toplevel_resize_edge edge;
if (!mp_input_test_dragging(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y) &&
- check_for_resize(wl, wl->opts->edge_pixels_touch, &edge))
+ !wl->locked_size && check_for_resize(wl, wl->opts->edge_pixels_touch, &edge))
{
xdg_toplevel_resize(wl->xdg_toplevel, s->seat, serial, edge);
+ // Explicitly send an UP event after the client finishes a resize
+ mp_input_put_key(wl->vo->input_ctx, MP_MBTN_LEFT | MP_KEY_STATE_UP);
} else {
// Save the serial and seat for voctrl-initialized dragging requests.
s->pointer_serial = serial;
wl->last_button_seat = s;
}
-
- mp_input_set_mouse_pos(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y);
- mp_input_put_key(wl->vo->input_ctx, MP_MBTN_LEFT | MP_KEY_STATE_DOWN);
}
static void touch_handle_up(void *data, struct wl_touch *wl_touch,