History

x11: don't unconditionally move the window on geometry changes

With the pieces set in place with the previous changes, we can implement the desired behavior. The trick here is that we do want to force centering the window when mpv first initially starts and the window size is not known yet. This can be done by simply checking x11->pseudo_mapped. The other change is to just look if we have the VO_WIN_FORCE_POS flag and feed that to highlevel resize.

Dudemanguy committed 2 years ago

Commit 2fa87111 parent e01eab41 file · +3 −2Browse files

Unified · Split

video/out/x11_common.c+3−2
@@ -1809,7 +1809,8 @@ void vo_x11_config_vo_window(struct vo *vo) · 1808 unmodified lines
18091809 vo_x11_update_screeninfo(vo);
18101810
18111811 struct vo_win_geometry geo;
1812− vo_calc_window_geometry(vo, &x11->screenrc, &x11->screenrc, x11->dpi_scale, false, &geo);
1812+ vo_calc_window_geometry(vo, &x11->screenrc, &x11->screenrc, x11->dpi_scale,
1813+ !x11->pseudo_mapped, &geo);
18131814 vo_apply_window_geometry(vo, &geo);
18141815
18151816 struct mp_rect rc = geo.win;
@@ -1833,7 +1834,7 @@ void vo_x11_config_vo_window(struct vo *vo) · 17 unmodified lines
18331834 x11->nofsrc = rc;
18341835 vo_x11_map_window(vo, rc);
18351836 } else if (reset_size) {
1836− vo_x11_highlevel_resize(vo, rc, x11->geometry_change);
1837+ vo_x11_highlevel_resize(vo, rc, geo.flags & VO_WIN_FORCE_POS);
18371838 }
18381839
18391840 x11->geometry_change = false;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t