To replace all occuring format strings inside the msg, replace_all had
been used previously. This leads to buggy behavior, if a format string
occurs in the replaced text, as the format string will get replaced
again under certain conditions.
Introducing a pointer, which skips the already replaced parts, will
prevent doubly replacing format strings from content.
Fixes#322
When a notification contains both a raw icon and an icon path according
to the GNOME notification specification the raw icon should take
priority over anything else.
If, however, a user uses the new_icon rule to set a custom icon on a
notification, that rule overwrote the icon path and not the raw icon
and as a result the raw icon was displayed in place of the user
specified one.
As a simple fix, a new icon_overridden boolean was added to the
notification struct indicating if a custom icon has been set. If so, the
icon path should take priority over the raw icon.
Fixes#339
Displaying too heavy notifications can DoS dunst. For example bad
programs, which pipe raw image data into the notification.
Limiting the maximum character length to 5000 circumvents this.
5000 should be ridiculously high to prevent DoS while still not
truncating all correct notifications.
There is no reason for the frame settings to have their own section
since it's not an area that will be expanded upon. Move them to the
global section to be consistent.
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.
The 'Github Flavored Markdown' specification says that headers must be
followed by a space character, update the changelog to respect that
requirement.
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.