mirror of https://github.com/mpv-player/mpv
x11: fix --hidpi-window-scale=no on hidpi screens
In this combination, the [current-]window-scale properties still incorrectly applied scaling. For some reason, vo_calc_window_geometry2() handled this option (basically ignored the dpi_scale parameter passed to it), but since the DPI compensation for window-scale is implemented in x11_common.c, we need to check and honor this option here too. (What a mess.)
This commit is contained in:
parent
5d9aa72f25
commit
65e9139764
|
@ -623,7 +623,7 @@ int vo_x11_init(struct vo *vo)
|
||||||
double dpi_x = x11->ws_width * 25.4 / w_mm;
|
double dpi_x = x11->ws_width * 25.4 / w_mm;
|
||||||
double dpi_y = x11->ws_height * 25.4 / h_mm;
|
double dpi_y = x11->ws_height * 25.4 / h_mm;
|
||||||
double base_dpi = 96;
|
double base_dpi = 96;
|
||||||
if (isfinite(dpi_x) && isfinite(dpi_y)) {
|
if (isfinite(dpi_x) && isfinite(dpi_y) && x11->opts->hidpi_window_scale) {
|
||||||
int s_x = lrint(MPCLAMP(dpi_x / base_dpi, 0, 10));
|
int s_x = lrint(MPCLAMP(dpi_x / base_dpi, 0, 10));
|
||||||
int s_y = lrint(MPCLAMP(dpi_y / base_dpi, 0, 10));
|
int s_y = lrint(MPCLAMP(dpi_y / base_dpi, 0, 10));
|
||||||
if (s_x == s_y && s_x > 1 && s_x < 10) {
|
if (s_x == s_y && s_x > 1 && s_x < 10) {
|
||||||
|
|
Loading…
Reference in New Issue