Skip to content

wayland: only reuse old size if both width and height are 0 #16149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions video/out/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,14 +1307,22 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
}
}

/* Reuse old size if either of these are 0. */
if (width == 0 || height == 0) {
/* Reuse old size if both of these are 0. */
if (width == 0 && height == 0) {
if (!wl->locked_size) {
wl->geometry = wl->window_size;
}
goto resize;
}

// If either of these is 0, we're allowed to grow in that dimension. Start
// at current window size in that case.
if (width == 0) {
width = mp_rect_w(wl->window_size);
} else if (height == 0) {
height = mp_rect_h(wl->window_size);
}

if (!wl->locked_size) {
apply_keepaspect(wl, &width, &height);
wl->window_size.x0 = 0;
Expand Down
Loading