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
1809 vo_x11_update_screeninfo(vo);1809 vo_x11_update_screeninfo(vo);
1810 1810
1811 struct vo_win_geometry geo;1811 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);
1813 vo_apply_window_geometry(vo, &geo);1814 vo_apply_window_geometry(vo, &geo);
1814 1815
1815 struct mp_rect rc = geo.win;1816 struct mp_rect rc = geo.win;
@@ -1833,7 +1834,7 @@ void vo_x11_config_vo_window(struct vo *vo) · 17 unmodified lines
1833 x11->nofsrc = rc;1834 x11->nofsrc = rc;
1834 vo_x11_map_window(vo, rc);1835 vo_x11_map_window(vo, rc);
1835 } else if (reset_size) {1836 } 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);
1837 }1838 }
1838 1839
1839 x11->geometry_change = false;1840 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