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.
This commit is contained in:
Dudemanguy committed 2026-04-10 14:00:50 +00:00
1 parent 75939c2116
commit fd2215eef4
1 file changed
+8 -9
+8 -9
View File
@@ -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)