mirror of https://github.com/mpv-player/mpv
options: --geometry: center window position after applying size
Center window position after applying W and H parameters of the --geometry option. Passing valid X and Y values will still override the position. Fixes #2397.
This commit is contained in:
parent
5a3c299ca1
commit
c4e8c36071
|
@ -2089,6 +2089,10 @@ void m_geometry_apply(int *xpos, int *ypos, int *widw, int *widh,
|
|||
} else if (!(gm->w > 0) && gm->h > 0) {
|
||||
*widw = *widh * asp;
|
||||
}
|
||||
// Center window after resize. If valid x:y values are passed to
|
||||
// geometry, then those values will be overriden.
|
||||
*xpos += prew / 2 - *widw / 2;
|
||||
*ypos += preh / 2 - *widh / 2;
|
||||
}
|
||||
|
||||
if (gm->xy_valid) {
|
||||
|
|
Loading…
Reference in New Issue