As per discussion in #334 drop dependency on gtk3 and instead depend
only on gdk-pixbuf2 for icon loading.
The only gtk3 function used was gdk_cairo_set_source_pixbuf in order to
convert the loaded pixbufs into cairo surfaces for us to render. In
order to drop the dependency this step was bypassed by using pixbufs
export to png capability and importing it into cairo via a pngstream.
The commit 7f335b7 introduced, that specific notifications did not time
out properly. Although these had been internally closed already, X11
still displayed them.
There is no need save if the icon field should have precedence, as
setting raw_icon to NULL emphasizes the same.
Also freeing raw_icon saves unneccessary memory.
time(NULL) is vulnerable against timeshifts by NTP, timezones,...
g_get_monotonic_time() is not, but counts its in microseconds with the
gint64 datatype. To prevent any conversion bugs, all internal
timeformats are now using a gint64 and only get converted during import
or export (DBus notification arrives, configuration reading, age
threshold display).
To achieve a consistent scheme, all stars of the
pointers should be on the side of the variable and
not on the side of the type.
wrong: char* a
wrong: char * a
good: char *a
This commit is generated by the following sed command
with manual fixes of all false positives.
find src \( -name '*.c' -or -name '*.h' \) -print0
| xargs -0 -n1 sed -i
's/\([a-zA-Z]\+[-_a-zA-Z0-9]*\)\s*\*\s\+
\([a-zA-Z]\+[-_a-zA-Z0-9]*\)/\1 *\2/g'
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
A middle click on an notification with a single or default action will
invoke it. If there are multiple actions and no default, the context
menu is opened. If there are no actions, proceed similarly with URLs.
Expose events, according to the X11 documentation, signify when the
contents of a window region have been lost but until now we have been
ignoring this event for unknown reasons.
Handle this event by redrawing the window entirely. While this is not a
perfect solution, the optimal one would be to only redraw the
region that was lost, it's simpler to implement currently and better
than losing the contents of the window entirely.
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.