1055 Commits

Author SHA1 Message Date
Benedikt Heine
8f5afaafb6 Do not redraw window on PropertyChange
When receiving a PropertyChange XEvent, it's mostly because the focus of
another window changed to another window. This isn't actually neccessary
for dunst. We need the event only, to know, when the screens have
switched.

As redrawing the screen became more expensive with the drop of GTK3, we
have to ignore this event and only really redraw the window, when the
focus has moved to another screen.
2017-12-25 15:53:20 +01:00
Benedikt Heine
a5d722799e Insert actual screen number into screen info struct
The screen info struct contained always a 0 in its screen number field.
So it always had been scr1 == scr2.
2017-12-22 22:27:09 +01:00
Benedikt Heine
d7ec8bf165 Explain counterintuitive gdk pixbuf conversion 2017-12-22 22:27:08 +01:00
Benedikt Heine
a6dea0cc35 Use GByteArray for bytebuffer in pixbuf conversion 2017-12-22 22:27:08 +01:00
Nikos Tsipinakis
0afdda11f3 Drop dependency on gtk3
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.
2017-12-22 22:27:08 +01:00
Nikos Tsipinakis
4908a75a89
Merge pull request #460 from bebehei/dbus
Output the PID of the current FDN daemon
2017-12-21 16:34:48 +02:00
Nikos Tsipinakis
5a9f37b07f
Merge pull request #462 from bebehei/valgrind
Add valgrind to travis configuration and check for leaks
2017-12-19 19:19:07 +02:00
Benedikt Heine
48ec829c74 Do not move memory to itself
To move the memory is only needed, when the memory is really freshly
allocated.
2017-12-19 11:50:03 +01:00
Benedikt Heine
1d39aa348c Add valgrind to travis configuration and check for leaks 2017-12-19 11:37:28 +01:00
Benedikt Heine
3c7f8409f0 Output the PID of the current FDN daemon
When the DBus name lost function is called, either the whole DBus
connection is lost, or another rivaling FDN daemon acquired the name.
Without enough experience, this is impossible to trace back and examine
further.

To make it easier for new users, dunst prints out the PID of the
process, which currently acquired the FDN DBus name.
2017-12-19 10:04:03 +01:00
Benedikt Heine
b9f347d80a
Merge pull request #461 from dunst-project/coveralls
Coveralls
2017-12-19 10:02:35 +01:00
Nikos Tsipinakis
885245a1ed Fix indentation in travis.yml
Indentation in travis.yml was inconsistent, update it to consistently
use 2 spaces.

I considered using 4 spaces to be more consistent with the rest of the
project but it looks too spaced out and doesn't suit YAML in my opinion.
2017-12-19 06:38:24 +02:00
Nikos Tsipinakis
74c3330669 Add coveralls
Send test coverage statistics to coveralls to provide a visual way to
monitor the progress of our testing suite.
2017-12-19 06:38:24 +02:00
Benedikt Heine
35dbd00611
Merge pull request #428 from bebehei/refactor-notification_init
Refactor notification init
2017-12-18 00:55:59 +01:00
Nikos Tsipinakis
9ed461e73a
Merge pull request #459 from bebehei/dbus-macros
Pack FDN specific names into macro
2017-12-17 16:56:30 +02:00
Benedikt Heine
09c1ca7127 Pack FDN specific names into macro 2017-12-16 16:30:40 +01:00
Benedikt Heine
aae73d888e Show multiple URLs pretty with print 2017-12-15 00:16:31 +01:00
Benedikt Heine
3face4ae72 Split notification assembly into separate method
Handle replaces_id now via n->id
2017-12-15 00:16:31 +01:00
Benedikt Heine
b97a49c09b Fix memory leak colors given via hints
The hints given via DBus are not constants. Therefore the color fields
have to get freed during notification cleanup. As it's not possible to
disinguish, which field is constant, we have to duplicate the settings
on assignment.
2017-12-15 00:16:31 +01:00
Benedikt Heine
98d905b8e4 Strip [linktext] before opening URL
[linktext] can contain arbitary data and also a possible URL, which
would get passed to the browser, making the actual URL invalid.
2017-12-15 00:16:31 +01:00
Benedikt Heine
acd8be51ab Remove a and img tags from msg
While the notification spec allows tags like <a href="...">...</a> and
<img src="..." alt="...">, pango cannot parse these tags and therefore
these tags should be removed before passed to pango.

Also the method notification_extract_markup_urls is not needed anymore,
as markup_strip_a can return URLs optionally.

This implies, that URL replacement is now indicated via show_indicators
for URLs and the dmenu string is in the format of
'[text between a tags] URL\n'. This is similarly handled for images,
too.
2017-12-15 00:16:31 +01:00
Benedikt Heine
f7d4dab51f
Merge pull request #455 from tostiheld/patch-1
Fix typo in README.md
2017-12-12 19:22:57 +01:00
thomas
f6850389ec
Fix typo in README.md
...since I also fixed it on the website (:
2017-12-12 19:00:37 +01:00
Nikos Tsipinakis
e51ac67715
Merge pull request #453 from tsipinakis/fix-emiting-signal-on-redisplayed
Don't emit NotificationClosed signal on redisplayed notifications
2017-12-10 16:00:11 +02:00
Nikos Tsipinakis
0c8d3a4084 Don't emit NotificationClosed signal on redisplayed notifications
The signal_notification_closed function is called even when a
notification has been pulled from history and re-emits the
NotificationClosed signal, this can confuse clients since multiple such
signals are not accounted for in the spec.
2017-12-09 17:12:31 +02:00
Nikos Tsipinakis
ff6f3e496c Prefix signal functions with signal_
Make dbus function that emit a signal easier to distinguish by prefixing
them with 'signal_'.
2017-12-09 17:03:56 +02:00
Nikos Tsipinakis
85c3c08668
Merge pull request #454 from bebehei/no-dbus-conn-error
Distinguish DBus connection and name acquired error
2017-12-08 17:51:45 +02:00
Benedikt Heine
16aefbabe3 Distinguish DBus connection and name acquired error
Distinguish between a failure to connect to DBus and a failure to
connect to the actual FDN DBus path.

This is possible, because `on_name_acquired` gets its DBus connection
passed as a parameter. If this parameter is NULL, there is no connection
established and the DBus name is not lost, because another notification
daemon is running.
2017-12-07 02:37:34 +01:00
Nikos Tsipinakis
c04fce1461
Merge pull request #452 from bebehei/fail-on-missing-config
Fail when config file given via option not found
2017-12-06 16:41:44 +02:00
Benedikt Heine
48dc3d2458 Fail when config file given via option not found 2017-12-06 14:48:22 +01:00
Benedikt Heine
4bfae81f18 Split and refactor notification_init
Unboil the spaghetti code and split it into separate methods.
2017-12-04 20:27:33 +01:00
Nikos Tsipinakis
75fddab7bd
Merge pull request #449 from bebehei/fix-notification-timeouts
Fix notification timeouts
2017-12-02 08:56:43 +02:00
Benedikt Heine
1c53ae7f9c Clean up dunst.h 2017-11-29 12:46:54 +01:00
Benedikt Heine
b7b8362175 Remove timeout_cnt
The structure is not needed, as next_timeout gets invalidated via
current time and not the amount of all timeouts.
2017-11-29 12:46:54 +01:00
Benedikt Heine
2a823eb381 Check if next_timeout is in past
When having a long running notification and an additional two shorter
notifications arrive. The short notification, which times out later,
does not timeout correctly and gets flushed only, when the long running
notification is flushed or a Focus* XEvent is sent.
2017-11-29 12:46:54 +01:00
Benedikt Heine
1fc96e9691 Call XFlush after redrawing the window
The commit 7f335b7 introduced, that specific notifications did not time
out properly. Although these had been internally closed already, X11
still displayed them.
2017-11-29 12:46:39 +01:00
Benedikt Heine
43b9c45cd8 Clearify structures in dunst:run 2017-11-26 21:17:42 +01:00
Benedikt Heine
eae071f330 Rename color_strings to colors
This is an antipattern and makes linelength increase for nothing
2017-11-25 10:58:25 +01:00
Benedikt Heine
d190af6db1 Restructure notification struct and add comments 2017-11-25 10:58:25 +01:00
Benedikt Heine
714731e8fc
Merge pull request #447 from bebehei/image-path
Support image-path hint
2017-11-25 10:56:47 +01:00
Nikos Tsipinakis
62e8b043c7
Merge pull request #448 from bebehei/style
Style adaptions
2017-11-25 09:43:28 +02:00
Benedikt Heine
0ad63d2c2c Don't indent switch labels 2017-11-25 02:16:45 +01:00
Benedikt Heine
5b2a6e57b7 curly braces style
Curly braces should start on a new line, after a method declaration, but
should continue on the same line after a control structure.
2017-11-25 02:15:30 +01:00
Benedikt Heine
bd8fd8b1d2 Improve whitespace handling 2017-11-25 01:38:28 +01:00
Benedikt Heine
fc4f0a4238 Refactor arguments into one line
Parameters should not cover an area. All arguments should be on a single
line (either horizontally or vertically).
2017-11-25 01:32:06 +01:00
Benedikt Heine
caa63d6275 Sort includes alphabetically 2017-11-25 01:28:03 +01:00
Benedikt Heine
34ee1744dd Support image-path hint
As GApplications expose their icon via image-path hint and not via the
actual app_icon field, GApplication icons haven't been displayed before.

According to the notification spec, image-path hint should also override
the app_icon as follows:

1. image-data hint
2. image-path hint
3. app_icon parameter
2017-11-25 00:23:19 +01:00
Benedikt Heine
7191104147
Merge pull request #444 from bebehei/dunstify-utf8-icon
Set Locale in dunstify
2017-11-24 02:35:33 +01:00
Benedikt Heine
664ec413aa Set Locale in dunstify
If specifying --icon with UTF-8 characters, the g_option_context_parse
fails with an invalid byte conversion. The solution is to set the locale
explicitly.

For more info, see the GLib issue tracker:
https://bugzilla.gnome.org/show_bug.cgi?id=737137

Fixes #443
2017-11-23 11:43:52 +01:00
Benedikt Heine
6e9a805017
Merge pull request #439 from bebehei/duplicate-notifications
Duplicate notifications
2017-11-22 18:25:37 +01:00