Commit Graph

234 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee a7fd2e2278 naughty.notification: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee e4d88e5566 naughty.list.notifications: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 51a1d387e5 naughty.list.actions: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee eb21c24acb naughty.layout.box: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee c3a73cab53 naughty.core: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 85eb759bd8 naughty.container.background: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 6b382148a8 naughty.action: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 86d1b1c22c doc: Add a mandatory `@noreturn` for functions and methods.
The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
2022-08-29 22:49:45 -07:00
Emmanuel Lepage Vallee 4bd90f0f35 doc: Add documentation linting and fix all issues it found. 2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallee f3987f43b6 doc: More proof reading fixes. 2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallee 75ab366769 doc: Proof reading fixes.
* Rendering problems
 * Incomplete type information
 * Obsolete type information
 * Missing type information
 * Missing return value
 * Incomplete return value type
2022-08-29 22:48:54 -07:00
Lucas Schwiderski 51c184fc06
refactor(naughty.notification): Align table values 2022-05-29 10:52:20 +02:00
Lucas Schwiderski 62f13d3e08
fix(naughty.notification): Fix missing accessor
Fixes #3623.
2022-05-29 10:52:11 +02:00
HumblePresent 030073fee7 Apply presets before registering notification 2021-11-26 13:22:58 -06:00
Emmanuel Lepage Vallee 9dcfde32e0 naughty: Never hold a strong reference to the notification in the box.
luajit was failing to GC the notification about 5% of the time. This
commit stores all widget notifications in a weak table and don't let
any lambda access the parent object notification object.

Each of those changes reduces the failure rate. There might still be
a couple in there, but the test passed 200x on my laptop with 100%
success rate.
2021-10-31 19:30:17 -07:00
Emmanuel Lepage Vallée 5f29d6d056
Update lib/naughty/notification.lua
Co-authored-by: Aire-One <aireone@aireone.xyz>
2021-10-14 20:51:31 -07:00
Emmanuel Lepage Vallee 0b075761e3 naughty: Fix the `ignore_suspend` property.
By fixing some suspend bugs a few weeks ago, I "regressed" this
a little. By that, I mean there were bugs in the suspend code
which caused `ignore_suspend` to work simply because suspend
globally failed rather than `ignore_suspend` being implemented
correctly.

Fix #3465
2021-10-14 14:03:39 -07:00
Emmanuel Lepage Vallee 9c22b029eb naughty.layout.box: Make sure discarded boxes don't come back to life.
Previously, when resuming a notification for which the popup was closed,
it would re-appear.
2021-10-05 13:00:14 -07:00
Emmanuel Lepage Vallee 3458c89040 naughty: Suspend existing notifications.
Previously, it would just suspend new notification, but do nothing
about the existing ones.
2021-10-05 13:00:14 -07:00
Emmanuel Lepage Vallee 075935fd37 naughty: Do not call `request::display` when suspended.
Fix #3396
2021-10-05 12:59:39 -07:00
Emmanuel Lepage Vallee 0d1e977917 naughty: Fix getting a notification by id.
There is more into that table than just screens. If `get_by_id` was
called with an invalid notification (or a "future" one in case of
suspended / do_not_disturb), it would explode.
2021-10-05 12:59:39 -07:00
Elyes HAOUAS f81723733c
lib/naughty/init.lua: Fix typo on "screen" (#3456)
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-05 12:13:33 -07:00
Emmanuel Lepage Vallee b038463e22 naughty.legacy: Handle broken configs betters.
If a config with naughty.layouts.box crashes at startup and the
fallback config uses naughty.layouts.legaxy, it is possible their
will be some lookup for an object which isn't tracked by the legacy
module.
2021-09-22 19:17:02 -07:00
Emmanuel Lepage Vallee bd8f2f936b naughty: Fix a memory leak related to suspended notifications. 2021-09-22 19:17:02 -07:00
Emmanuel Lepage Vallee e752943b98 notification: Correctly handle `screen` set in the presets.
It was setting directly to `_private`, which both didn't work
and caused a memory leak.

Fix #3428
2021-09-22 19:17:02 -07:00
Emmanuel Lepage Vallee 21a111d154 naughty: Allow to set the message from the presets again.
This was never really supported and is really not what the presets
were event meant to be used for. But it worked and `lain` used it.
2021-09-22 19:17:02 -07:00
Emmanuel Lepage Vallee 89c84caee4 naughty.legacy: Explicitly remove the screen.
Do not rely on the GC. It isn't reliable with Luajit.
2021-09-22 13:39:58 -07:00
Emmanuel Lepage Vallée c3a508a886
Merge pull request #3386 from Elv13/awful_wibar
Fix some wibar bugs, polish the API a bit and add some doc.
2021-09-19 13:05:11 -07:00
Emmanuel Lepage Vallee e27b908ca0 doc: Document the naughty.action "invoked" signal. 2021-09-16 17:25:46 -07:00
Emmanuel Lepage Vallee 17bd5fb036 naughty: Pass the notification object to the action "invoked" signal.
Fix #3384
2021-09-16 17:22:33 -07:00
Emmanuel Lepage Vallee 4b606fb3d7 notification: Fix rendering during early screen creation.
If the problem happens early enough, it was possible that the
screen arrway wasn't initialized yet. In that case, the notification
would fail to render.
2021-09-12 01:59:48 -07:00
Emmanuel Lepage Vallee 90c4c60d2a Add more @supermodule and @hidden 2021-04-02 19:24:07 +02:00
Emmanuel Lepage Vallée 50fa1b8679
naughty: Correctly notify the client when a notification is dismissed. (#3184)
Fix #3182

Co-authored-by: Uli Schlachter <psychon@znc.in>
2021-03-22 00:03:37 -07:00
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
Yauhen Kirylau e7113d7191
fix(naughty: layout: box): take preset.padding and beautiful.notification_spacing into account (#3103) 2020-05-22 21:55:47 -07:00
actionless 124c6f9b23 fix(naughty: widget: _markup): correctly un-escape "&lt;span property=value&gt;" 2020-04-23 13:44:34 +02:00
Emmanuel Lepage Vallee 9601cf4a89 naughty: Plug to the permission system.
This allows to control which kind of icon actions can be done
on individual notifications. Once the second part of the permission
system will be merged, this will mostly be used in `ruled.notification`.
2020-03-16 04:46:51 -04:00
Emmanuel Lepage Vallee 4492a37885 naughty: Use a request handler to clear the notification icon. 2020-03-16 04:45:52 -04:00
Emmanuel Lepage Vallee c75203ac03 naughty: Handle icon paths with file:// in them. 2020-03-16 04:44:11 -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 c3cdac368d naughty: Stop request::icon as soon as there is an icon. 2020-03-16 04:43:53 -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 21cb4037bc naughty: Fix updating the icon of DBus notification when passed by path. 2020-03-08 19:44:16 -04:00
Emmanuel Lepage Vallee 97e403b4e9 naughty: Correctly scale large square icons.
Fix #3005
2020-03-07 21:34:02 -05:00
Emmanuel Lepage Vallee a69b6123b8 naughty: Fix updating `naughty.widget.icon`.
It was never call, untested and obviously broken...
2020-03-07 21:34:02 -05:00
Emmanuel Lepage Vallee d5b652973f naughty: Emit `property::icon` when the `image` or `images` change.
This way updating the icon at least *can* work.
2020-03-07 21:34:02 -05:00
Emmanuel Lepage Vallee b6ce95cd15 naughty: Improve the rendering of notifications with invalid markup.
Some case like `foo<b>bar` still fail, but at least `foo<<<>>>bar`
works.

Fix #3022
2020-03-07 21:34:02 -05:00
Emmanuel Lepage Vallée 3bd777f61a
Revert "naughty.widget: xml_escape message and title text" 2020-03-05 01:38:27 -05:00