541 Commits

Author SHA1 Message Date
Benedikt Heine
7a02d8e48a Microoptimisation in get_sleep_time
Setting the value to INT_MAX instead of 0 allows to remove the boolean
check if value even has been set.
2017-10-07 17:45:57 +02:00
Nikos Tsipinakis
a56bdd18c1 Merge pull request #401 from bebehei/flickerless-replace
Update notification attributes upon direct replace
2017-10-06 22:32:49 +03:00
Nikos Tsipinakis
a18b4d8895 Merge pull request #402 from bebehei/unused-fields
Remove unused struct fields
2017-10-06 22:29:01 +03:00
Nikos Tsipinakis
478377815f Merge pull request #403 from bebehei/redo-354
Work around non-gnu basename implementations
2017-10-06 22:24:39 +03:00
Nikos Tsipinakis
c55308b8a7 Initialize icons before parsing the format
Since the format supports flags for including the icon name in the
notification the icon should be initialized first (and set to the
default if not set) in order for the flag to function properly.
2017-10-06 22:14:37 +03:00
Benedikt Heine
9aba546258 Work around non-gnu basename implementations
Redo #354, as it got pushed out in #365
2017-10-06 20:29:21 +02:00
Benedikt Heine
d6c1fbb556 Remove unused struct fields 2017-10-06 18:33:56 +02:00
Nikos Tsipinakis
0a3298dde4 Merge pull request #387 from bebehei/tests-for-string-append
Tests for string append
2017-10-06 18:17:50 +03:00
Benedikt Heine
e8f152b5d0 Update notification attributes upon direct replace 2017-10-06 13:31:26 +02:00
Benedikt Heine
6e654eb751 Improve usage of string_append 2017-10-06 13:13:47 +02:00
Benedikt Heine
a6301ff464 Do not concatenate empty strings with separator 2017-10-06 13:13:47 +02:00
Nikos Tsipinakis
82d544e95e Merge pull request #391 from bebehei/flickerless-replace
Replace notifications flickerless
2017-10-05 16:34:26 +03:00
Benedikt Heine
5680291c20 Fix small memory leak 2017-10-05 12:39:58 +02:00
Benedikt Heine
1533fcd782 Replace notifications flickerless
Previously, notifications had been replaced by removing the notification
out of the displayed/queue lists, redrawing the window and then adding
the new notification into the queue. This produced a flickering in
dunst.

By avoiding the overhead of closing and opening the window (simply
replacing the datapointer of the list), the flickering disappears.
2017-09-27 00:24:21 +02:00
Nikos Tsipinakis
a64cb82946 Merge pull request #388 from fhost/fhost/ellipsize
Use config.h for default ellipsize value
2017-09-26 09:32:11 +03:00
Benedikt Heine
a1781a451b Check for b value if null in string_append
This avoids "a", NULL, "sep" to come to "asep" instead of "a".
2017-09-25 03:55:19 +02:00
Benedikt Heine
41defb7c85 Break overlong argument lists 2017-09-25 02:26:11 +02:00
Benedikt Heine
554c873808 Mark constant strings as const
It's hard to trace back, which methods in option parser require freeing
the result and which prohibit it. Marking all non-freeable values as
const lets this problem solve the compiler.
2017-09-25 02:26:11 +02:00
fhost
f9f6830c71 Use config.h for default ellipsize value
Get the default value for ellipsize from config.h, instead of
setting it in two different places (in case it is not set, and in
case its value is invalid).
2017-09-24 16:53:58 +02:00
Nikos Tsipinakis
4316c85e18 Merge pull request #374 from fhost/fhost/ellipsize
Add option to control how to ellipsize truncated lines
2017-09-20 16:40:22 +03:00
Nikos Tsipinakis
ad31bb975c Merge pull request #381 from bebehei/typo-1
Rename double to int
2017-09-20 10:32:29 +03:00
fhost
f4b595240a Add option to control how to ellipsize truncated lines 2017-09-19 20:03:16 +02:00
Benedikt Heine
530eaaf5ed Rename double to int 2017-09-19 13:26:30 +02:00
Benedikt Heine
1c7f674ee0 Correct indentation 2017-09-19 00:10:36 +02:00
Benedikt Heine
e16117ca30 Use double pointers for haystack 2017-09-07 15:25:54 +02:00
Benedikt Heine
4b7f656f6e Interpret '%%' as literal '%' in format 2017-09-07 15:25:21 +02:00
Benedikt Heine
ab9bf55892 Prevent replacement of format strings in message
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
2017-09-07 15:25:14 +02:00
Nikos Tsipinakis
16bbde5bf3 Merge pull request #343 from bebehei/transient-notifications
add support for transient hints
2017-09-07 14:01:19 +03:00
Benedikt Heine
759aa518d5 Refactor star scheme of pointers
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'
2017-09-06 23:14:25 +02:00
Benedikt Heine
a833b4a0f4 Fix memory leak in get_pixbuf_from_path
If the svg-file is not found, the string containing the svg ending is
never freed again.
2017-08-30 19:41:15 +02:00
Nikos Tsipinakis
eb0a0f8602 Fix infinite loop when checking timeouts
Move the iter pointer to the next item before doing any logic that might
result in exiting from the current iteration of the loop since it would
cause the same notification to be processed repeatedly resulting in an
infinite loop.

Fixes 362.
2017-08-19 20:37:54 +03:00
Benedikt Heine
d4f6726944 Add rule to ignore transient settings 2017-08-19 12:46:33 +02:00
Benedikt Heine
02ba060490 Refactor if chain to avoid nested statements 2017-08-19 12:46:00 +02:00
Benedikt Heine
585f0f85e0 Add support for transistent hints 2017-08-19 12:46:00 +02:00
Nikos Tsipinakis
3c257eaeb7 Merge pull request #351 from bebehei/wordexp
replace variables and ~ in script paths
2017-08-19 10:12:16 +03:00
Benedikt Heine
8e3a7586d1 replace ~/ in script paths 2017-08-15 23:35:02 +02:00
Dmitri Goutnik
bf98183098 Add libgen.h include and guard against basename(3) modifying its arg 2017-08-15 10:44:32 -05:00
Nikos Tsipinakis
99c74b8703 Merge pull request #352 from bebehei/nextiter
Optimize check_timeouts
2017-08-15 11:49:45 +03:00
Benedikt Heine
66fceb9661 handle removing of elements in GList correctly
When closing a notification in check_timeouts, iter will get removed
of the list and therefore iter->next is NULL at the end of the
loop. This requires calling check_timeouts again.

Shifting iter to iter->next before removing the notification, we can
avoid recalling check_timeouts and avoid processing the already
processed list again.
2017-08-14 11:00:33 +02:00
Steven Schäfer
d61a6183a5 parse raw icons from the (deprecated) image_data attribute 2017-08-06 22:11:10 +02:00
Benedikt Heine
b7ff4f9f1f print usage only on stdout 2017-08-04 09:55:59 +02:00
Nikos Tsipinakis
f14301292c Merge pull request #346 from bebehei/reorder-getopt
change order of option_get_* to be displayed during --help
2017-08-01 19:26:51 +03:00
George Angelopoulos
9acb9fd255 add backwards compatibility for icon_folders option
Existing configurations will continue to work but now print a warning.
New, icon_path option takes precedence if both options are used.
If icon_folders option is used, its usage string also appears in --help
output.
2017-08-01 12:51:00 +02:00
Benedikt Heine
677e1f14ca change order of option_get_* to be displayed during --help 2017-08-01 12:21:55 +02:00
George Angelopoulos
4d03acc454 replace 'folder' with 'path' in icon functionality
"folder" is more of a windows term. In unix we have paths and
directories.
2017-07-29 15:16:08 +02:00
Benedikt Heine
7443021897 fix typos and reformat print output 2017-07-24 22:31:06 +02:00
Benedikt Heine
c9980347cf improve readability in dbus.c 2017-07-23 02:12:10 +02:00
Nikos Tsipinakis
86cbc1d34b Make icon set via rules take priority over raw icons
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
2017-07-19 09:13:19 +03:00
Nikos Tsipinakis
599db75401 Add deprecation warning for the frame section 2017-07-11 11:08:36 +03:00
Nikos Tsipinakis
842a35db06 Make per_monitor_dpi take precedence over Xft.dpi
If the per-monitor dpi feature has been enabled it shouldn't be overridden
just because an Xft.dpi value is set, it's possibly for other programs
that don't have such a feature.
2017-07-11 10:12:56 +03:00