x11: handle maximized windows with window-scale

If a user attempted to change the window scale of a maximized window on
x11, nothing would happen since the window manager holds the size of the
window constant. Just do an unmaximize first before performing the
resize.
This commit is contained in:
Dudemanguy 2021-08-07 20:10:56 -05:00
parent b692c6599a
commit f4ceea9b8a
1 changed files with 6 additions and 0 deletions

View File

@ -1912,6 +1912,12 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
struct mp_rect rc = x11->winrc;
rc.x1 = rc.x0 + w;
rc.y1 = rc.y0 + h;
if (x11->opts->window_maximized) {
x11->opts->window_maximized = false;
m_config_cache_write_opt(x11->opts_cache,
&x11->opts->window_maximized);
vo_x11_maximize(vo);
}
vo_x11_highlevel_resize(vo, rc);
if (!x11->fs) { // guess new window size, instead of waiting for X
x11->winrc.x1 = x11->winrc.x0 + w;