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

Use native D-Bus and libnotify implementation #28

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

impl
Copy link
Contributor

@impl impl commented Sep 1, 2021

This change makes the libnotify-compatible notifications more resilient by switching to a different library that uses a native implementation of the D-Bus protocol.

The prior implementation of the notifications code reserved a single notification identifier when the program started; however, some notification daemons (like mate-notification-daemon) automatically terminate after some period of notification inactivity. They are reactivated by writing new notifications via D-Bus. In this case, the generated ID would no longer make sense to the newly activated process, and show the notification would fail.

With the help of the new library, this change keeps track of the notification ID and only reserves it while the notification is actually being shown.

@maximbaz
Copy link
Owner

maximbaz commented Sep 1, 2021

Thanks for your contribution! I'll try to get this tested and merged in the following days!

@emansom
Copy link

emansom commented Sep 8, 2021

Was about to open a bug report for this. Thanks for contributing a fix already! 🎉 😃 👍

Copy link
Owner

@maximbaz maximbaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me! One small request and lets get this merged! 🙏

notifier/libnotify.go Outdated Show resolved Hide resolved
This change makes the libnotify-compatible notifications more resilient
by switching to a different library that uses a native implementation of
the D-Bus protocol.

The prior implementation of the notifications code reserved a single
notification identifier when the program started; however, some
notification daemons (like mate-notification-daemon) automatically
terminate after some period of notification inactivity. They are
reactivated by writing new notifications via D-Bus. In this case, the
generated ID would no longer make sense to the newly activated process,
and show the notification would fail.

With the help of the new library, this change keeps track of the
notification ID and only reserves it while the notification is actually
being shown.
@maximbaz maximbaz merged commit becf4ad into maximbaz:main Sep 11, 2021
@maximbaz
Copy link
Owner

Many thanks 😉

@emansom
Copy link

emansom commented Sep 30, 2021

@maximbaz Please tag a new release including this MR. 👍

@maximbaz
Copy link
Owner

maximbaz commented Oct 1, 2021

Done, enjoy 😉

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