1430 Commits

Author SHA1 Message Date
Nikos Tsipinakis
0e56c61f8f Fix dunstify --close description 2019-02-28 15:25:41 +02:00
Nikos Tsipinakis
7b3d85a6d0
Merge pull request #548 from knopwob/icon_size
limit icon size when we have a fixed width
2019-02-14 11:57:48 +02:00
Sascha kruse
c99f715391 Limit icon size when we have a fixed width
Fix #540
2019-02-13 12:01:35 +02:00
Nikos Tsipinakis
63ec283c5a
Merge pull request #590 from mgsloan/skip-display-rule-option
Skip display rule option
2019-02-09 11:33:26 +02:00
Nikos Tsipinakis
9e8142af44
Merge pull request #603 from tsipinakis/test-install
Test installation
2019-02-06 18:14:46 +02:00
Michael Sloan
802b1abb09 Use queues_notification_close for skip_display instead of queues_history_push
https://github.com/dunst-project/dunst/pull/590
2019-02-05 13:36:56 -08:00
Nikos Tsipinakis
2fb1de8f02 Test installation
Ensure that dunst is installed correctly to avoid bugs like #600.
2019-02-05 23:11:35 +02:00
Nikos Tsipinakis
2568727e4c
Merge pull request #601 from rhssk/manprefix
Remove trailing spaces from MANPREFIX path
2019-02-03 11:40:45 +02:00
Rihards Skuja
dcd3238327
Remove trailing spaces from MANPREFIX path
Variables with trailing comments include the spaces leading up to the
comment (https://www.gnu.org/software/make/manual/make.html#Flavors)
so the corresponding install command looked like
"install -Dm644 docs/dunst.1 $(DESTDIR)/usr/share/man /man1/dunst.1"
2019-02-03 11:24:02 +02:00
Nikos Tsipinakis
ce5721af73
Merge pull request #600 from bebehei/makefile
Improve makefile
2019-02-03 10:39:34 +02:00
Benedikt Heine
4590514906 Replace Makefile commands with default variables 2019-02-02 16:50:59 +01:00
Benedikt Heine
6df6a50900 Use BINDIR, DATADIR and MANDIR in Makefile 2019-02-02 16:50:49 +01:00
Michael Sloan
977a7a7ea4 New rule option: skip_display 2019-01-30 23:50:33 -08:00
Michael Sloan
e2854c1843 Revert "Add a tip to the docs about how to skip initial display"
This reverts commit 81de607e88f85075fc8f113886d9b3960ae19321.
2019-01-30 23:50:33 -08:00
Benedikt Heine
10ce9f36af
Merge pull request #595 from tsipinakis/makefile-deps
Fix makefile not recompiling on header change
2019-01-29 01:19:28 +01:00
Nikos Tsipinakis
e288fe4b93 Fix makefile not recompiling on header change
We currently do not keep track of header files in our Makefile so if one
is changed it can lead to multiple incompatible binary files being
linked. Instead we now create dependency lists for each source file and
recompile them if the need arises.

Fixes #594
2019-01-28 09:49:46 +02:00
Nikos Tsipinakis
dd6320a0a9
Merge pull request #592 from bebehei/desktop-entry
Desktop entry filters.
2019-01-25 14:09:13 +02:00
Benedikt Heine
7fff1d13c1 Add docs for desktop-entry filter 2019-01-25 08:00:25 +01:00
Benedikt Heine
3bb6df2f1e Format rule fields as a list 2019-01-25 07:59:11 +01:00
Benedikt Heine
1e82c761c9 Add support for desktop-entry hints 2019-01-25 07:59:01 +01:00
Benedikt Heine
c87feb7c1f
Merge pull request #593 from bebehei/issue-589
Harden against undefined X Atoms
2019-01-25 07:54:12 +01:00
Benedikt Heine
19c9a8e296 Harden against undefined X Atoms
Fixes #589
2019-01-23 17:56:59 +01:00
Benedikt Heine
3828cca699 Introduce rule_new 2019-01-23 16:20:21 +01:00
Benedikt Heine
53ad430b48 Compose rule matching function more readable 2019-01-23 16:11:22 +01:00
Nikos Tsipinakis
fb29047679
Merge pull request #588 from mgsloan/document-skipping-initial-display
Add a tip to the docs about how to skip initial display
2019-01-13 17:57:24 +02:00
Nikos Tsipinakis
c8c7d2e675
Merge pull request #587 from mgsloan/fix-notification-decode-error-handling
Fix handling of case where notification decode failure occurs
2019-01-13 17:48:02 +02:00
Nikos Tsipinakis
b0db27eed4
Merge pull request #586 from bebehei/checksummed-icons
Checksummed icons
2019-01-13 17:34:11 +02:00
Michael Sloan
81de607e88 Add a tip to the docs about how to skip initial display
My usecase is that I don't want to get notified for every new song
that plays (it's distracting), but I do want to bring them up via the
notification history.
2019-01-13 01:42:53 -08:00
Michael Sloan
dd54709b9e Fix handling of case where notification decode failure occurs
I'm not sure whether this case can happen in the wild, but if
artifically exercising the condition, I noticed it behaves
poorly. Specifically:

* The error_name parameter must be a valid D-Bus error name. It seems
  conventional to set this to "org.freedesktop.Notifications.Error".
  Without this change, the following error is thrown:

  CRITICAL: g_dbus_method_invocation_return_dbus_error: assertion 'error_name != NULL && g_dbus_is_name (error_name)' failed

* Previously execution would continue even though the notification did
  not decode, causing essentially a null pointer exception later.
  Adds a return for this case.

* With those two things fixed, this case seems relatively silent -
  "notify-send" invocations succeed even if the condition for the if
  is "true". So, I added a warning log to indicate that this case is
  occurring
2019-01-13 01:15:19 -08:00
Benedikt Heine
6f8b53c4e8 Compare raw icons by their checksums
Currently, we just skipped the notification comparison, if the
notification had a raw icon attached. This is a bit counterintuitive.

Calculating a checksum of the raw icon's data is the solution.

For that we cache the pixel buffer and introduce a field, which saves
the current icon's id. The icon_id may be a path or a hash.
So you can compare two notifications by their icon_id field regardless
of their icon type by their icon_id field.
2019-01-11 13:10:37 +01:00
Benedikt Heine
5627d06070 Pass NULL instead of empty string to option parser
A bug, introduced in #576. If alignment isn't set in the config, the
settings would print a warning about an invalid value. But actually it's
just the default string, which can't get parsed.

The fallback value should get handled by a false return value and not by
the option_get_string's default value.
2019-01-09 13:12:46 +01:00
Benedikt Heine
8a46b88da9 Use g_strcmp0 for string comparisons
g_strcmp0 handles NULL values correctly. This allows to omit NULL
pointer checks, which would be otherwise crucial.
2019-01-07 17:56:00 +01:00
Benedikt Heine
f9f5804b08 Remove notification_icon_get wrapper 2019-01-07 17:56:00 +01:00
Benedikt Heine
cd09d5a88e Cache GdkPixbuf in notification structure 2019-01-07 17:56:00 +01:00
Benedikt Heine
088907488c Rename icon field to iconname 2019-01-07 17:56:00 +01:00
Benedikt Heine
4043e1a18e Refactor pixbuf scaling into seperate method 2019-01-07 17:56:00 +01:00
Benedikt Heine
6a8f1c52c3
Merge pull request #576 from bebehei/settings-p1
Settings (part 1/x)
2019-01-07 17:17:16 +01:00
Nikos Tsipinakis
ebaa4a97d2
Merge pull request #585 from bebehei/cairo-conversion
Manually convert GdkPixbuf to cairo surfaces
2019-01-07 18:13:12 +02:00
Benedikt Heine
41ce7cce4a Add string_parse_* functions
Changes all string parsers to have a the almost same interface while
also having a proper return value, which indicates success of the
parsing process.
2019-01-07 15:32:28 +01:00
Benedikt Heine
8579b3ed6b Add assertion macro to return values
Just recently, I started using g_return_val_if_fail as a brief assertion
checker. It'll also exit the function with a specified return value.

But actually this introduces some weird behavior. It's configurable by
environment variables and it'll print out a log message, if the
expression didn't validate properly. But some of these assertions are
actually ment to be silent.

Using a simple macro makes it simple to structure the assertions and its
return values in a block at the start of a function or anywhere else.
2019-01-07 15:30:42 +01:00
Benedikt Heine
56f2adb106 Manually convert GdkPixbuf to cairo surfaces
As already noted in the code comment, we all knew that the in memory
conversion to a PNG stream is a cumbersome technique. But it was worth
to remove the GTK dependency.

After finding out, that gdk_pixbuf_new_from_data can actually use a
GVariant and share its memory without allocating new memory, I poked
the cairo docs for a similar technique.

There is cairo_image_surface_create_for_data, which would achieve the
same, but cairo uses another color byte order. So we have to manually
copy and reassemble the bytes.

It may look like a big rise in complexity, but actually, it's straight
forward copying pixel by pixel and changing the byte's order.

And the gdk_pixbuf_to_cairo_surface is 33x faster.
2019-01-07 00:45:34 +01:00
Benedikt Heine
595ffc294a
Merge pull request #584 from bebehei/test-printlog
Control to print log messages during test
2019-01-05 20:51:27 +01:00
Benedikt Heine
319e18e449 Use master branch for coveralls badge image 2019-01-05 15:56:27 +01:00
Benedikt Heine
0e0af0d8ec
Merge pull request #582 from bebehei/dbus-test2
Test raw icon assembly in DBus
2019-01-05 15:43:40 +01:00
Benedikt Heine
4fe0ee95d7
Merge pull request #581 from bebehei/notification-tests
Improve notification tests
2019-01-05 15:39:09 +01:00
Benedikt Heine
7092e54840 Control to print log messages during test
The log messages are useless during general and automated testing. But
while developing tests, the warning messages might be an easy debugging
option to check why one's own test currently fails.
2019-01-04 22:35:30 +01:00
Benedikt Heine
d1700dc3eb Test raw icon assembly in DBus 2019-01-03 18:39:22 +01:00
Benedikt Heine
c37326c9a0 Move memory allocation into test methods
This implies, that memory will only get freed, if the whole test method
is gone through. In case of failure, memory leaks aren't important. But
it's crucial not to fail with a segfault just for an assertion.

Fixes #580
2019-01-03 12:21:05 +01:00
Benedikt Heine
84e5a0bf26 Make notification_is_duplicate test icons
Before, it only did test for `ASSERT_FALSE` both times. So a raw_image
wasn't guaranteed to be a condition to falsify the return.

Using the single field function, will test for both cases.
2019-01-03 12:19:53 +01:00
Benedikt Heine
c1090ad7dc
Merge pull request #568 from bebehei/dbus-test
Dbus test
2018-12-31 05:58:14 +01:00