summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-04-12 12:04:03 -0500
committerDudemanguy <random342@airmail.cc>2024-04-13 14:33:58 +0000
commit307255d00d5ab7a7e51a247cd1aa75218611d8d7 (patch)
tree699500b9db2e896e850d532548342162a22f56f1 /video/out
parent4023146a04be2bd4aaf46e57cac80c7883a9239b (diff)
downloadmpv-307255d00d5ab7a7e51a247cd1aa75218611d8d7.tar.bz2
mpv-307255d00d5ab7a7e51a247cd1aa75218611d8d7.tar.xz
wayland: avoid unneeded calls to xdg_toplevel state functions
The reconfigure event handles setting fullscreen, maximize, etc. We were implictly relying on the compositor to just ignore mpv if we set a redundant state (e.g. setting fullscreen when we're already fullscreen), but kwin actually doesn't and operates again. This causes some subtle issues when handling geometry on state changes. Rework the state change calls so they are only executed if wl->geometry_configured isn't set yet (i.e. the window just opened up for the first time). It's the only time this is actually needed.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 0a87296e19..7a2346d759 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -2620,22 +2620,23 @@ bool vo_wayland_reconfig(struct vo *vo)
if (wl->opts->configure_bounds)
set_window_bounds(wl);
- if (!wl->geometry_configured || !wl->locked_size) {
- wl->geometry = wl->window_size;
- wl->geometry_configured = true;
- }
-
if (wl->vo_opts->cursor_passthrough)
set_input_region(wl, true);
- if (wl->vo_opts->fullscreen)
- toggle_fullscreen(wl);
+ if (!wl->geometry_configured || !wl->locked_size)
+ wl->geometry = wl->window_size;
+
+ if (!wl->geometry_configured) {
+ if (wl->vo_opts->fullscreen)
+ toggle_fullscreen(wl);
- if (wl->vo_opts->window_maximized)
- toggle_maximized(wl);
+ if (wl->vo_opts->window_maximized)
+ toggle_maximized(wl);
- if (wl->vo_opts->window_minimized)
- do_minimize(wl);
+ if (wl->vo_opts->window_minimized)
+ do_minimize(wl);
+ wl->geometry_configured = true;
+ }
prepare_resize(wl);