Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add on_cleared event #208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhrozenByte
Copy link
Contributor

@PhrozenByte PhrozenByte commented Nov 26, 2024

This event is fired when a notification was closed without user interaction, e.g. because the notification timed out (DBus only, and only if supported by the notifications server; undetectable by capabilities), or because the notification was closed by another process (DBus only).

We'll later also utilize this for the cross-platform implementation of timeout.

Without this new event we'd have to remove the if reason == NOTIFICATION_CLOSED_DISMISSED: check in DBusDesktopNotifier.

ToDo:

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.14%. Comparing base (26c6af2) to head (4968441).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/desktop_notifier/backends/winrt.py 0.00% 3 Missing ⚠️
src/desktop_notifier/main.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #208   +/-   ##
=======================================
  Coverage   85.13%   85.14%           
=======================================
  Files          10       10           
  Lines         895      922   +27     
=======================================
+ Hits          762      785   +23     
- Misses        133      137    +4     
Flag Coverage Δ
pytest 85.14% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This event is fired when a notification was closed without user interaction, e.g. because the notification timed out (DBus only, and only if supported by the notifications server; undetectable by capabilities), or because the notification was closed by another process (DBus only).
@PhrozenByte PhrozenByte force-pushed the enhancement/event-on_cleared branch from 9a16756 to 4968441 Compare November 26, 2024 13:32
@PhrozenByte PhrozenByte mentioned this pull request Nov 26, 2024
8 tasks
@samschott
Copy link
Owner

As for #209, could you check if similar events are available on macOS and Windows?

@PhrozenByte
Copy link
Contributor Author

Windows doesn't have a similar event (I checked).

Can't say anything about OS X because I neither understand their overly complex API, nor do I have an Apple device to do manual testing. I'm afraid anything OS-X-related is up to you.

As said earlier, my ultimate goal is to use this for #206 too, i.e. independent of the backend used. I'm just not sure yet how to prevent calling the dismissal class-level handler. However, this isn't really relevant here, see #206.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants