Skip to content

Commit

Permalink
video/out/w32_common: don't move window if position isn't set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
na-na-hi authored and kasper93 committed Nov 2, 2024
1 parent 512f5e2 commit e734f5a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions video/out/w32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,8 +1944,13 @@ static void window_reconfig(struct vo_w32_state *w32, bool force)
w32->o_dheight = vo->dheight;

if (!w32->parent && (!w32->window_bounds_initialized || force)) {
SetRect(&w32->windowrc, geo.win.x0, geo.win.y0,
geo.win.x0 + vo->dwidth, geo.win.y0 + vo->dheight);
int x0 = geo.win.x0;
int y0 = geo.win.y0;
if (!w32->opts->geometry.xy_valid && w32->window_bounds_initialized) {
x0 = w32->windowrc.left;
y0 = w32->windowrc.top;
}
SetRect(&w32->windowrc, x0, y0, x0 + vo->dwidth, y0 + vo->dheight);
w32->prev_windowrc = w32->windowrc;
w32->window_bounds_initialized = true;
w32->win_force_pos = geo.flags & VO_WIN_FORCE_POS;
Expand Down

0 comments on commit e734f5a

Please sign in to comment.