Commit Graph

30 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallée 5cbc423938
notifications: Make `:reset_timer()` more intuitive. (#3175)
Previously it would only work if there already was a timeout to
avoid some infinite loops. Now it just delay the new timer to the
next loop.

Fix #3147
2020-09-27 23:34:14 -07:00
Emmanuel Lepage Vallee 0cbb7f59b0 naughty: Improve backward compatibility to protecting the constants.
If the user copy/pasted `naughty.config.*` into their config rather
than set values 1 by 1, we could no longer add new values since they
would get removed. To prevent more users being affected by this, we
now silently ignore the new table while still setting all the values.

Fix #3145
2020-09-14 02:11:32 -07:00
Emmanuel Lepage Vallee 64fb498422 tests: Test the newly added notification icon request handlers. 2020-03-16 04:44:15 -04:00
Emmanuel Lepage Vallee 32fd11a220 naughty: Move the get_icon implementation to 2 request handlers.
They can now be disconnected or extended.
2020-03-16 04:44:10 -04:00
Emmanuel Lepage Vallee 9e19e7a18c tests: Test naughty request::icon. 2020-03-16 04:43:55 -04:00
Emmanuel Lepage Vallee a3c37382be naughty: Add a new request::icon for the main icon.
My initial implementation was overly optimistic. It turns out there
is no end in sight to "correctly" support icons. Apps randomly use
XDG name, paths and URLs. Rather than baloon the size of the
implementation, this commit moves toward to request:: pattern
found in other APIs. This will allow people who wish to "fix"
specific icons to do so in a way that scales.

The next 2 commits will move the current implementation to request
handlers.
2020-03-15 03:35:40 -04:00
Emmanuel Lepage Vallee 9cf717b994 naughty: Replace request::icon by request::action_icon.
It wasn't a good idea to use ::icon because sometime the notification
themselves needs to request assistance for their icons.
2020-03-14 20:21:35 -04:00
Emmanuel Lepage Vallee b8e00b245f tests: Trigger the widget "update content" code path. 2020-03-08 20:14:53 -04:00
Emmanuel Lepage Vallee 21caa19a21 naughty: Add a way to revert to the legacy mode.
When `rc.lua` will use the new notification API by default, we need
a way to revert back to the lagacy mode to be able to test it.
2020-02-10 04:13:17 -05:00
Daniel Hahler dc98eade3b
naughty: fix extra newline with only title/message (#2870)
* tests/test-naughty-legacy.lua: s/counter/added_counter

* naughty: fix extra newline with only title/message

With only title or message it should not have an extra newline.

Fixes: https://github.com/awesomeWM/awesome/commit/423aeebe8#commitcomment-35062951
2019-09-19 02:11:18 +02:00
Daniel Hahler 0cbf536269
test-naughty-legacy.lua: harden/cleanup (#2873) 2019-09-13 16:00:51 +02:00
Emmanuel Lepage Vallee 6d58d7b4a2 tests: Test that the legacy naughty popup is used when the new API fails
Displaying errors is important. If the notification popup caused the
error, it was likely nothing could be displayed.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 529f4be53e tests: Check that naughty emits "request::display_error" when needed. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee aed2af44b6 tests: Check if using client icon doesn't exceed the size constraints. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 6761778830 tests: Test the notification icon theme request::icon support. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 4fe05a566d tests: Test exposing the notification persistence and animation props 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 7d609fb69b tests: Test the notification spec v1.2 "resident notification" support.
If a notification is resident, invoking an action should not destroy it.
If an action is not resident, invoking an action destroys it.
2019-08-03 01:45:22 -04:00
Michael Beaumont 9e2a544ba3 naughty: Add position "middle" to center notifications in screen (#2775)
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
2019-06-08 16:10:14 -04:00
Emmanuel Lepage Vallee 0b820b077d tests: Fix the tests then notify-send is not installed.
Fix #2684
2019-03-03 16:24:17 -05:00
Emmanuel Lepage Vallee 4930978424 naighty: Fix to use the same object using `naugthy.notify{replace_id}`
Fix #2678
2019-03-03 16:24:17 -05:00
Emmanuel Lepage Vallee 9954e43521 tests: Use the same string for both notification lines.
Otherwise you cannot compare the width since `r` is thinner than `z`
in some non-monospace fonts.
2019-03-02 12:51:03 -05:00
Emmanuel Lepage Vallée f049046332
Merge pull request #2696 from alfunx/naughty-legacy-resize-on-update
naughty: Resize notification when setting text
2019-02-24 15:12:35 -05:00
Alphonse Mariya 04c9477f73
test: Test notification resizing on text change 2019-02-24 19:46:25 +01:00
Emmanuel Lepage Vallee e9d44e820d test: Test the notification ids 2019-02-24 12:08:50 -05:00
Emmanuel Lepage Vallee ecec00f425 tests: Disable a test that's invalid 2019-02-22 11:47:46 -05:00
Uli Schlachter 828ce1471e test-naughty-legacy: Use GDBus instead of spawning dbus-send
This is inspired to be a correctness fix: The "hints" argument to
notifications is supposed to have type a{sv}, i.e. this maps from string
keys to some generic value. dbus-send does not support this and instead
it sends an argument of type a{ss}, i.e. a mapping from string to
string. This commit fixes this problem and uses the correct type.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-19 18:35:09 +01:00
Uli Schlachter a54eb67de0 naughty test: Use array-style spawn() calls
When a string is spawned, the C code has to split this into an array for
the execve() syscall. When an array is given directly, this array does
not need to be transformed in any way. This makes it much more clear
what is actually started.

This commit removes some quotation marks that were previously removed by
the C code. For example,

    array:string:1,"four",2,"five",3,"six"

became

    array:string:1,four,2,five,3,six

because otherwise the action was called "four" instead of four and the
test failed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-17 10:30:31 +01:00
Uli Schlachter 083462e0c1 naughty test: Warn about missing dependencies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-17 10:21:18 +01:00
Emmanuel Lepage Vallee 1b4c1e9f1c tests: Test the naughty deprecated APIs 2019-02-16 15:49:39 -05:00
Emmanuel Lepage Vallee db591b50a4 tests: Add extensive tests for the existing notification features.
This new test suit add a rather extensive coverage to the "legacy"
notification popups. A few minor bugs have been found and fixed
and we can rest assured that the new spec 1.2 support and extended
manipulation API wont regress existing configs.
2019-02-16 15:49:39 -05:00