Skip to content

Commit

Permalink
win32: clean up hidpi window scale behavior
Browse files Browse the repository at this point in the history
Same as X11. An accurate dpi scale should always be reported and
UNFS_WINDOW_SIZE shouldn't take dpi scale as an additional multiplier.
  • Loading branch information
Dudemanguy committed Feb 24, 2024
1 parent 0068224 commit a3648dd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions video/out/w32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static void update_dpi(struct vo_w32_state *w32)
}

w32->dpi = dpi;
w32->dpi_scale = w32->opts->hidpi_window_scale ? w32->dpi / 96.0 : 1.0;
w32->dpi_scale = w32->dpi / 96.0;
signal_events(w32, VO_EVENT_DPI);
}

Expand Down Expand Up @@ -2092,8 +2092,8 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg)
return VO_FALSE;

RECT *rc = w32->current_fs ? &w32->prev_windowrc : &w32->windowrc;
s[0] = rect_w(*rc) / w32->dpi_scale;
s[1] = rect_h(*rc) / w32->dpi_scale;
s[0] = rect_w(*rc);
s[1] = rect_h(*rc);
return VO_TRUE;
}
case VOCTRL_SET_UNFS_WINDOW_SIZE: {
Expand All @@ -2102,9 +2102,6 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg)
if (!w32->window_bounds_initialized)
return VO_FALSE;

s[0] *= w32->dpi_scale;
s[1] *= w32->dpi_scale;

RECT *rc = w32->current_fs ? &w32->prev_windowrc : &w32->windowrc;
resize_and_move_rect(w32, rc, s[0], s[1]);

Expand Down

0 comments on commit a3648dd

Please sign in to comment.