mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 00:07:33 +00:00
wayland: actually handle 0x0 resizes correctly
According to the xdg-shell protocol spec, a 0x0 size from the compositor means that "the client should decide its own window dimension". We were not doing this correctly. What should happen is that mpv should simply reuse the old window size if it is not maximized or fullscreened. This should work on all (reasonably recent) versions of mutter and an compositor that follows the spec. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/stable/xdg-shell/xdg-shell.xml#L1050
This commit is contained in:
parent
5bcf061744
commit
073fbd98ee
@ -842,6 +842,14 @@ 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) {
|
||||
if (!is_fullscreen && !is_maximized) {
|
||||
wl->geometry = wl->window_size;
|
||||
}
|
||||
goto resize;
|
||||
}
|
||||
|
||||
if (old_toplevel_width == wl->toplevel_width &&
|
||||
old_toplevel_height == wl->toplevel_height)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user