Replace the dependency list in the README to mention libxrandr instead
of libxinerama since that's the default value of the MULTIMON variable
in config.mk
Use a single MULTIMON variable which can be set to either xrandr,
xinerama or none and replace the previous system which used 2 variables
for each extension which were then added to CFLAGS and instead append
xrandr or xinerama respectively to pkg_config_packs so their
availability can be checked with pkg-config.
The main advantage of this is that the extension can now be set from
the command like like so 'MULTIMON=xinerama make'
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.
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.
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
x.c has grown into an unmaintainable blob. Moving it in its own
subdirectory is the first step to splitting it into submodules each of
which will have a well defined job so that a lot of the code can be
abstracted to improve readability and make it much easier to maintain.
This process will be done one small part at a time only when we need to
change significantly change a part of the file, there is no need to
break what already works.
If Xft.dpi value is not available, auto-detect value based on monitor using randr provided sizes.
Disable Xinerama and enable randr by default.
Also update dpi everytime the monitor changes.
When checking for the markup value in rules, an empty string was
specified as the default value so it can easily be checked if the actual
config value was empty or not. While that string got strdup'ed in the
ini_get_string call, it was only freed if the length > 0, effectively
leaking a tiny amount of memory.
Change that behaviour to use a NULL check instead to avoid leaking
memory.
Remove xext and xft as a dependency since they are not currently used
and probably haven't been used a while.
Also remove freetype2 from the pkg-config list, while it is required by
pangocairo it should be included from the pkg-config --cflags call.
The 'Github Flavored Markdown' specification says that headers must be
followed by a space character, update the changelog to respect that
requirement.
Because "&" is not the last character to be unescaped, it is possible that
the lines for "<" and ">" expand some things they shouldn't.
For example, "&lt;" should become "<", but instead it becomes ">".
While this is unlikely to appear naturally in a notification, it is wrong.
This turns a hard-to-understand nested if{} chain into a simple switch
statement, and pulls some code out in to utility functions.
This is strictly a code-organization change, and should contain no
functional changes.
If dmenu didn't return anything we returned out of the function without
calling `waitpid` to collect the childs exit code, leaving to the child
process to be left as a zombie indefinitely. This commit makes `waitpid`
be called before the return checks are done.
When generating the list of urls to pass to dmenu, string_append with a
newline as a separator was called unconditionally. This caused a newline
character to be added for each notification even if it didn't contain
any urls, leading to empty items in dmenu.
Fixes#300
A lot of error reporting used a simple `printf` call which by default
prints to stdout. This was changed so that all error reporting is done
by an `fprintf(stderr, ...)` call.
It doesn't make much sense to print usage into to stderr. What's more is
that it prevents users from easily piping the output to other
programs(i.e. grep)
According to the glib memory allocation documentation, if any memory
allocation calls fail the application will be terminated so there is no
need to check if the call succeeded.
multi-user.target isn't a valid user target and it doesn't make sense to run
dunst as a system service.
Eventually, this unit should probably be converted to use
graphical-session.target but it's a bit unclear how that's supposed to work
right now.
Show what is happening during build etc, the way most other make-based
projects do.
There is thus no need for the options target. Additionally, this target
caused unnecessary rebuilds of ./dunst each and every time, even on
`make install`.
'True' and 'False' are defined in Xlib.h
Since we use stdbool boolean 'true' and 'false' definitions in several
places, it's best not to mix boolean macros. So in the sake of
consistency switch to using the stdbool macros project-wide.