From fd2215eef4102babfea5be76ca0532ef9893c023 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 8 Apr 2026 11:10:38 -0500 Subject: [PATCH] wayland: override surface local coordinates on reconfigures We don't want to be using the coordinates from the compositor in this case since it can't know that the new surface has a totally different aspect ratio. Also remove the early return so that the state is always updated regardless if it's determined we need to resize or not. Fixes #17710. --- video/out/wayland_common.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 43701a9df6..a3b030143f 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1879,7 +1879,6 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel, wl->tiled = is_tiled; wl->locked_size = is_fullscreen || is_maximized || is_tiled; - wl->reconfigured = false; if (wl->requested_decoration) request_decoration_mode(wl, wl->requested_decoration); @@ -1927,17 +1926,17 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel, wl->surface_local.x1 = width; wl->surface_local.y1 = height; - if (mp_rect_equals(&old_geometry, &wl->geometry)) - return; - resize: - MP_VERBOSE(wl, "Resizing due to xdg from %ix%i to %ix%i\n", - mp_rect_w(old_geometry), mp_rect_h(old_geometry), - mp_rect_w(wl->geometry), mp_rect_h(wl->geometry)); + if (!mp_rect_equals(&old_geometry, &wl->geometry)) { + MP_VERBOSE(wl, "Resizing due to xdg from %ix%i to %ix%i\n", + mp_rect_w(old_geometry), mp_rect_h(old_geometry), + mp_rect_w(wl->geometry), mp_rect_h(wl->geometry)); + wl->pending_vo_events |= VO_EVENT_RESIZE; + } - wl->pending_vo_events |= VO_EVENT_RESIZE; - wl->override_surface_local = width == 0 || height == 0; + wl->override_surface_local = width == 0 || height == 0 || wl->reconfigured; wl->toplevel_configured = true; + wl->reconfigured = false; } static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel)