Skip to content

Commit fd2215e

Browse files
committed
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.
1 parent 75939c2 commit fd2215e

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

video/out/wayland_common.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,6 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
18791879
wl->tiled = is_tiled;
18801880

18811881
wl->locked_size = is_fullscreen || is_maximized || is_tiled;
1882-
wl->reconfigured = false;
18831882

18841883
if (wl->requested_decoration)
18851884
request_decoration_mode(wl, wl->requested_decoration);
@@ -1927,17 +1926,17 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
19271926
wl->surface_local.x1 = width;
19281927
wl->surface_local.y1 = height;
19291928

1930-
if (mp_rect_equals(&old_geometry, &wl->geometry))
1931-
return;
1932-
19331929
resize:
1934-
MP_VERBOSE(wl, "Resizing due to xdg from %ix%i to %ix%i\n",
1935-
mp_rect_w(old_geometry), mp_rect_h(old_geometry),
1936-
mp_rect_w(wl->geometry), mp_rect_h(wl->geometry));
1930+
if (!mp_rect_equals(&old_geometry, &wl->geometry)) {
1931+
MP_VERBOSE(wl, "Resizing due to xdg from %ix%i to %ix%i\n",
1932+
mp_rect_w(old_geometry), mp_rect_h(old_geometry),
1933+
mp_rect_w(wl->geometry), mp_rect_h(wl->geometry));
1934+
wl->pending_vo_events |= VO_EVENT_RESIZE;
1935+
}
19371936

1938-
wl->pending_vo_events |= VO_EVENT_RESIZE;
1939-
wl->override_surface_local = width == 0 || height == 0;
1937+
wl->override_surface_local = width == 0 || height == 0 || wl->reconfigured;
19401938
wl->toplevel_configured = true;
1939+
wl->reconfigured = false;
19411940
}
19421941

19431942
static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel)

0 commit comments

Comments
 (0)