1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

wayland: ignore 0x0 resizes

Apparently mutter can send us 0x0 resizes* for whatever reason. Probably
there's some interal reason why this occurs, but for us trying to resize
to 0x0 is obviously terrible and results in all kinds of brokenness.
Just ignore any 0 values. Fixes #9748.

*: https://gitlab.gnome.org/GNOME/mutter/-/issues/2091
This commit is contained in:
Dudemanguy 2022-01-23 13:41:11 -06:00
parent 93d77b781d
commit d16defac27

View File

@ -768,8 +768,9 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
wl->toplevel_width = width;
wl->toplevel_height = height;
/* Don't do anything here if we haven't finished setting geometry. */
if (mp_rect_w(wl->geometry) == 0 || mp_rect_h(wl->geometry) == 0)
/* Bail out if any of these values are 0 for any reason. */
if (mp_rect_w(wl->geometry) == 0 || mp_rect_h(wl->geometry) == 0 ||
width == 0 || height == 0)
return;
bool is_maximized = false;