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.
This commit is contained in:
Nikos Tsipinakis 2017-07-11 10:12:56 +03:00
parent c547f6eec9
commit 842a35db06
2 changed files with 7 additions and 3 deletions

View File

@ -208,7 +208,10 @@
# to have a consistent behaviour across releases. # to have a consistent behaviour across releases.
[experimental] [experimental]
# Calculate the dpi to use on a per-monitor basis. # 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 per_monitor_dpi = false
[shortcuts] [shortcuts]

View File

@ -239,9 +239,10 @@ sc_cleanup:
double get_dpi_for_screen(screen_info *scr) double get_dpi_for_screen(screen_info *scr)
{ {
double dpi = 0; double dpi = 0;
if ((dpi = get_xft_dpi_value())) if ((!settings.force_xinerama && settings.per_monitor_dpi &&
(dpi = autodetect_dpi(scr))))
return dpi; return dpi;
else if (settings.per_monitor_dpi && (dpi = autodetect_dpi(scr))) else if ((dpi = get_xft_dpi_value()))
return dpi; return dpi;
else else
return 96; return 96;