History

video/out/w32_common: don't move window if position isn't set

The geometry output of vo_calc_window_geometry does not have any information about the current window position. This causes the window to move when setting geometry even without setting x/y. Change it so that the window position is unchanged if x/y are not set and after startup.

nanahi committed 2 years ago

Commit e734f5a1 parent 512f5e21 file · +7 −2Browse files

Unified · Split

video/out/w32_common.c+7−2
@@ -1944,8 +1944,13 @@ static void window_reconfig(struct vo_w32_state *w32, bool force) · 1943 unmodified lines
19441944 w32->o_dheight = vo->dheight;
19451945
19461946 if (!w32->parent && (!w32->window_bounds_initialized || force)) {
1947− SetRect(&w32->windowrc, geo.win.x0, geo.win.y0,
1948− geo.win.x0 + vo->dwidth, geo.win.y0 + vo->dheight);
1947+ int x0 = geo.win.x0;
1948+ int y0 = geo.win.y0;
1949+ if (!w32->opts->geometry.xy_valid && w32->window_bounds_initialized) {
1950+ x0 = w32->windowrc.left;
1951+ y0 = w32->windowrc.top;
1952+ }
1953+ SetRect(&w32->windowrc, x0, y0, x0 + vo->dwidth, y0 + vo->dheight);
19491954 w32->prev_windowrc = w32->windowrc;
19501955 w32->window_bounds_initialized = true;
19511956 w32->win_force_pos = geo.flags & VO_WIN_FORCE_POS;

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