From 842a35db0650640ed5faa72d5129d0b03b8d69f7 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Tue, 11 Jul 2017 10:12:56 +0300 Subject: [PATCH] Make per_monitor_dpi take precedence over Xft.dpi If the per-monitor dpi feature has been enabled it shouldn't be overridden just because an Xft.dpi value is set, it's possibly for other programs that don't have such a feature. --- dunstrc | 5 ++++- src/x11/screen.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dunstrc b/dunstrc index e9654b9..f38d4ed 100644 --- a/dunstrc +++ b/dunstrc @@ -208,7 +208,10 @@ # to have a consistent behaviour across releases. [experimental] # Calculate the dpi to use on a per-monitor basis. - # Please note that this setting will not work if Xft.dpi X resource is set. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. per_monitor_dpi = false [shortcuts] diff --git a/src/x11/screen.c b/src/x11/screen.c index 3e75e0d..6fe1c4c 100644 --- a/src/x11/screen.c +++ b/src/x11/screen.c @@ -239,9 +239,10 @@ sc_cleanup: double get_dpi_for_screen(screen_info *scr) { double dpi = 0; - if ((dpi = get_xft_dpi_value())) + if ((!settings.force_xinerama && settings.per_monitor_dpi && + (dpi = autodetect_dpi(scr)))) return dpi; - else if (settings.per_monitor_dpi && (dpi = autodetect_dpi(scr))) + else if ((dpi = get_xft_dpi_value())) return dpi; else return 96;