507 Commits

Author SHA1 Message Date
Benedikt Heine
dd28e62c11 Add Error Handler to fullscreen check 2018-02-25 20:18:40 +01:00
Benedikt Heine
aa7a851fdd Catch screen without window 2018-02-25 20:18:40 +01:00
Benedikt Heine
f89ce8e16f Delay incoming notifications when fullscreens set 2018-02-25 20:18:40 +01:00
Benedikt Heine
bda8c1dbb2 Add rule to show notification on fullscreen 2018-02-25 20:18:40 +01:00
Benedikt Heine
9e824a79ee Add functions to check fullscreen windows 2018-02-25 20:18:36 +01:00
Benedikt Heine
28db0416b4
Merge pull request #491 from bebehei/docs
Parsable markup documentation with doxygen
2018-02-22 21:34:42 +01:00
Benedikt Heine
422f353243 Add initial doxygen documentation 2018-02-22 20:08:00 +01:00
Benedikt Heine
c4eb26e3f5 Remove unnecessary return value 2018-02-20 17:05:55 +01:00
Benedikt Heine
3b6c5299be Use void as argument for parameterless functions 2018-02-20 16:24:00 +01:00
Nikos Tsipinakis
8735c9d3d0
Remove binary file in source directory
This file was added in the logging PR probably by accident or as a
result of `git add --all` (which is why its usage is discouraged).
    
This should have really been caught during code review but accidents
happen!
2018-02-15 12:37:38 +02:00
Benedikt Heine
c3e8bedfab
Merge pull request #474 from bebehei/logging
Logging with GLib
2018-02-12 13:13:37 +01:00
Benedikt Heine
6402218205 Remove negative NULL-check warning
According to the docs in the GSourceFuncs, the timeout_ parameter can be
NULL. But when it's NULL, it would be equivalent to an invocation to
return -1 as timeout_ and FALSE as return value. This is exactly the
same, what we're doing if timeout_ is not NULL.
2018-02-02 17:29:05 +01:00
Benedikt Heine
1e6a15de00 Fix memleak 2018-02-02 17:29:05 +01:00
Benedikt Heine
280ec456a4 Allow to set the log level via options 2018-02-02 17:29:04 +01:00
Benedikt Heine
38dced7591 Translate last unusual logging calls 2018-02-02 17:29:04 +01:00
Benedikt Heine
58dc09b415 Replace PERR macro with appropriate logging macro 2018-02-02 17:29:04 +01:00
Benedikt Heine
19b364d67c Translate fprintf statements into log messages 2018-02-02 17:29:04 +01:00
Benedikt Heine
020a90e521 Replace die method with appropriate critical log 2018-02-02 17:29:04 +01:00
Benedikt Heine
2c503c2984 Add option to suppress log output when testing 2018-02-02 17:29:04 +01:00
Benedikt Heine
cad2ac34f9 Add GLib logging capabilities 2018-02-02 17:29:04 +01:00
Benedikt Heine
7bfb0b9b5f Handle execvp error when opening dmenu
The execvp function usually doesn't return and exits by itself. But,
when having an error, it returns. A faulty dmenu setting could trigger
this and stop dunst receiving signals.
2018-01-14 00:50:10 +01:00
Benedikt Heine
87c0fd4d90 Don't overwrite settings in children
string_append frees the first argument. While it's a setting,
settings.browser will contain a false dangling pointer.
2018-01-13 23:52:40 +01:00
Benedikt Heine
b209d06963 Handle execvp error in open_browser
The execvp function usually doesn't return and exits by itself. But,
when having an error, it returns. As a faulty browser setting could
trigger this, dunst has to handle this, as the forked child wants to
access the X11 server too, resulting in XIO errors.

Fixes #476
2018-01-13 15:18:02 +01:00
Nikos Tsipinakis
337d0a9cd1 Raise the maximum value of the progress hint
The progress hint is mostly used for progress bars but as discussed in
 #437 there are cases where values > 100 make sense.

Fixes #437
2018-01-05 21:55:15 +02:00
Nikos Tsipinakis
18df78c115
Merge pull request #468 from bebehei/dbus-acquisition-message
Improve wording of DBus name lost error message
2018-01-05 21:50:36 +02:00
Benedikt Heine
5f4d9c6685 Query the Notification Server name when dying 2018-01-05 18:13:26 +01:00
Nikos Tsipinakis
db0796b73d
Merge pull request #466 from bebehei/stdinconfig
Interpret - as STDIN config file
2018-01-05 18:05:04 +02:00
Benedikt Heine
b1aaee38f7
Merge pull request #376 from bebehei/drop-gtk
Drop gtk and use gdk-pixbuf
2017-12-26 15:33:29 +01:00
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
b337fdfefa Interpret - as STDIN config file 2017-12-23 02:09:32 +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
Benedikt Heine
6424f1a07b Make run static to not export it
This enforces to call wake_up in other files and not run(NULL).
2017-12-22 22:24:21 +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
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
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
35dbd00611
Merge pull request #428 from bebehei/refactor-notification_init
Refactor notification init
2017-12-18 00:55:59 +01: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
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