summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2024-02-12 13:51:25 +0100
committersfan5 <sfan5@live.de>2024-02-12 13:51:25 +0100
commit4981690fb63ca2b30fad1cf424e6a11234e34fa8 (patch)
tree4ad1c90c3510e028b43e60f66a8eb907defabf2e
parentcbcf12cdbd2f0df58fb5b18af7f277ffc26edf88 (diff)
downloadmpv-4981690fb63ca2b30fad1cf424e6a11234e34fa8.tar.bz2
mpv-4981690fb63ca2b30fad1cf424e6a11234e34fa8.tar.xz
x11_common: fix Xft.dpi detection ignoring --hidpi-window-scale
closes #13466 fixes: 4b691641472b487831a0b0f7637d5355d79387cd
-rw-r--r--video/out/x11_common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 088e0ac34f..83584795fb 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -617,7 +617,7 @@ static void vo_x11_get_x11_screen_dpi_scale(struct vo_x11_state *x11)
double dpi_x = x11->ws_width * 25.4 / w_mm;
double dpi_y = x11->ws_height * 25.4 / h_mm;
double base_dpi = 96;
- if (isfinite(dpi_x) && isfinite(dpi_y) && x11->opts->hidpi_window_scale) {
+ if (isfinite(dpi_x) && isfinite(dpi_y)) {
int s_x = lrint(MPCLAMP(2 * dpi_x / base_dpi, 0, 20));
int s_y = lrint(MPCLAMP(2 * dpi_y / base_dpi, 0, 20));
if (s_x == s_y && s_x > 2 && s_x < 20) {
@@ -731,8 +731,10 @@ bool vo_x11_init(struct vo *vo)
x11->ws_width, x11->ws_height, dispName,
x11->display_is_local ? "local" : "remote");
- if (!vo_x11_get_xft_dpi_scale(x11))
- vo_x11_get_x11_screen_dpi_scale(x11);
+ if (x11->opts->hidpi_window_scale) {
+ if (!vo_x11_get_xft_dpi_scale(x11))
+ vo_x11_get_x11_screen_dpi_scale(x11);
+ }
x11->wm_type = vo_wm_detect(vo);