From f7ccaee9fd76366eedbc47310463d6cb616c02ca Mon Sep 17 00:00:00 2001 From: llyyr Date: Sat, 14 Mar 2026 19:14:47 +0530 Subject: [PATCH 1/3] wayland: use wayland-edge-pixels-pointer for tablet input resize zone Tablet input is more similar to mouse input than it is to touch input, so it makes sens to use wayland-edge-pixels-pointer instead. Also document that it's used for tablet input, previously this was completely undocumented. --- DOCS/man/options.rst | 4 ++-- video/out/wayland_common.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 7b15e70008cd8..123c31b638777 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -6322,8 +6322,8 @@ them. ``--wayland-edge-pixels-pointer=`` Defines the size of an edge border (default: 16) to initiate client side - resize events in the wayland contexts with the mouse. This is only active if - there are no server side decorations from the compositor. + resize events in the wayland contexts with the mouse or tablet. This is only + active if there are no server side decorations from the compositor. ``--wayland-edge-pixels-touch=`` Defines the size of an edge border (default: 32) to initiate client side diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 75703956a0e6a..1d045669186a7 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -707,7 +707,7 @@ static void tablet_tool_handle_down(void *data, enum xdg_toplevel_resize_edge edge; if (!mp_input_test_dragging(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y) && !wl->locked_size && !wl->opts->border && - check_for_resize(wl, wl->opts->wl_edge_pixels_touch, &edge)) + check_for_resize(wl, wl->opts->wl_edge_pixels_pointer, &edge)) { xdg_toplevel_resize(wl->xdg_toplevel, tablet_tool->seat->seat, serial, edge); return; From 27f2695f7ecf71aec35de856e223b5c6be901e85 Mon Sep 17 00:00:00 2001 From: llyyr Date: Sat, 14 Mar 2026 19:16:28 +0530 Subject: [PATCH 2/3] wayland: document that wayland-edge-pixels-touch only affects CSD --- DOCS/man/options.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 123c31b638777..4a06e62b3e316 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -6327,7 +6327,8 @@ them. ``--wayland-edge-pixels-touch=`` Defines the size of an edge border (default: 32) to initiate client side - resizes events in the wayland contexts with touch events. + resizes events in the wayland contexts with touch events. This is only + active if there are no server side decorations from the compositor. ``--wayland-internal-vsync=`` Controls whether to use mpv's internal vsync for Wayland-base video outputs From b923b3f9b1d769a3a9817ff0d53e708127168ee6 Mon Sep 17 00:00:00 2001 From: llyyr Date: Sat, 14 Mar 2026 19:53:28 +0530 Subject: [PATCH 3/3] wayland: scale edge pixel threshold by scaling factor --- video/out/wayland_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 1d045669186a7..406bfaee2ad74 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2994,6 +2994,7 @@ static int check_for_resize(struct vo_wayland_state *wl, int edge_pixels, int pos[2] = { wl->mouse_x, wl->mouse_y }; *edges = 0; + edge_pixels = handle_round(wl->scaling, edge_pixels); if (pos[0] < edge_pixels) *edges |= XDG_TOPLEVEL_RESIZE_EDGE_LEFT; if (pos[0] > (mp_rect_w(wl->geometry) - edge_pixels))