summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-03-04 04:35:45 -0500
committerDudemanguy <random342@airmail.cc>2024-03-17 14:59:26 +0000
commit25ae54dd84ac6b1333aa1a78e526471b8e1d2778 (patch)
treef1e751901333e2b9cb07d9ade47ca1b090d6bf42
parent4370dc0cb6c4ec29e4ba0055458c2e2fc8d5da82 (diff)
downloadmpv-25ae54dd84ac6b1333aa1a78e526471b8e1d2778.tar.bz2
mpv-25ae54dd84ac6b1333aa1a78e526471b8e1d2778.tar.xz
x11_common: unmaximize window on runtime geometry change
8e793bde78f00fbb64223db30851c6d080c4abeb made that changing geometry while maximized has no effect until the window is unmaximazed. However, this behavior is inconsistent with setting window-scale on all of win32, wayland, and x11, which always unmaximizes the window and sets the window size. Since setting geometry is conceptually similar to setting window-scale (both change the window size), they should have the same behavior. If not fullscreen, unmaximize window on runtime geometry change to keep the behavior consistent with window-scale.
-rw-r--r--video/out/x11_common.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 47dc2c31b0..fa2f2ba38c 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1161,11 +1161,6 @@ static void vo_x11_check_net_wm_state_change(struct vo *vo)
XFree(elems);
}
- if (opts->window_maximized && !is_maximized && x11->geometry_change) {
- x11->geometry_change = false;
- vo_x11_config_vo_window(vo);
- }
-
opts->window_minimized = is_minimized;
x11->hidden = is_minimized;
m_config_cache_write_opt(x11->opts_cache, &opts->window_minimized);
@@ -1801,10 +1796,6 @@ void vo_x11_config_vo_window(struct vo *vo)
assert(x11->window);
- // Don't attempt to change autofit/geometry on maximized windows.
- if (x11->geometry_change && opts->window_maximized)
- return;
-
vo_x11_update_screeninfo(vo);
struct vo_win_geometry geo;
@@ -2098,6 +2089,12 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
if (opt == &opts->geometry || opt == &opts->autofit ||
opt == &opts->autofit_smaller || opt == &opts->autofit_larger)
{
+ if (opts->window_maximized && !opts->fullscreen) {
+ x11->opts->window_maximized = false;
+ m_config_cache_write_opt(x11->opts_cache,
+ &x11->opts->window_maximized);
+ vo_x11_maximize(vo);
+ }
vo_x11_set_geometry(vo);
}
}