summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-01-23 13:41:11 -0600
committerDudemanguy <random342@airmail.cc>2022-01-23 13:58:15 -0600
commitd16defac27fcfe3e5fc43af6e42c2e590988cd3d (patch)
tree64d0340d7bbb58cec251d10c9d92c2de3aea0670 /video/out
parent93d77b781d5d2a25f55f79393cbfbdc7b2290acd (diff)
downloadmpv-d16defac27fcfe3e5fc43af6e42c2e590988cd3d.tar.bz2
mpv-d16defac27fcfe3e5fc43af6e42c2e590988cd3d.tar.xz
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
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index ae657ec952..0806e048ed 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -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;