6 Commits

Author SHA1 Message Date
Nikos Tsipinakis
c547f6eec9 Add force_xinerama option
Since after the release a lot of downstream users will not be building
from source, it makes a lot more sense to have an option to fall back to
the Xinerama extension for those that are still on systems that do not
support RandR.
2017-07-10 14:38:20 +03:00
Nikos Tsipinakis
56dfc25baf Add warning if RandR initialization fails
Since currently the multimonitor extension support is a compile-time
argument, there is not much we can do to recover from not being able to
initialize RandR other than print an error and exit.
2017-05-04 17:53:01 +03:00
Nikos Tsipinakis
03c82c22e3 Fix uninitialized class name in dpi handling
Make the class in the XrmGetResource call be the same as the resource
name we are trying to retrieve, "Xft.dpi". Nowhere in the documentation
it is mentioned that the class name can be NULL so it is better to be
cautious and set it to a value that is unlikely to affect anything.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
43b4d4bb41 Add per_monitor_dpi experimental setting
Calculating the screen dpi on a per-monitor basis can cause
inconsistencies if multiple monitors with slightly different dpis are
used and in some cases it might not be the expected behaviour.

As such, the per-monitor dpi calculation was changed from a default
fallback to an opt in experimental feature and the default value of 96
will be used for the dpi if Xft.dpi is not set.

In the future, depending on how we decide to continue, we can either
move this setting in the global configuration section and fall back to
the X11 display dpi as the default or simply always use the per-monitor
dpi calculation. But to preserve backwards compatibility, this decision
can wait until the next major release.
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
52600cdfb0 Refactor monitor handling to keep track of all screens
Previously, we were getting screen info every time we tried to move the
window. To improve the situation, information about the available
screens is initialised once when dunst starts and further behaviour
depends on the compile-time options used.

If Xrandr is enabled, screen information is updated when an
XRRScreenChangeNotify event is received, meaning only when the screen
layout changes.

If Xinerama is enabled, screen information is only updated on startup.
This behaviour might be changed later.

If none are enabled, then dunst assumes only one screen and ignores all
multi-monitor options.
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
0a6b105f4a Move screen related code into a new file
Since we are adding Xrandr support to allow for automatic dpi detection,
split screen handling code into a new file as part of the effort to
simplify x.c
2017-04-02 18:27:12 +03:00