fix: keep GNOME notifications open (fix #2566) - #3588
Open
The-Best-Codes wants to merge 5 commits into
Open
The-Best-Codes wants to merge 5 commits into
The-Best-Codes wants to merge 5 commits into
Conversation
Signed-off-by: BestCodes <106822363+The-Best-Codes@users.noreply.github.com>
The-Best-Codes
marked this pull request as ready for review
September 15, 2026 21:04
Signed-off-by: BestCodes <106822363+The-Best-Codes@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2566.
On GNOME (possibly 46 and later, but I haven't tested on all versions), the notification server closes an FDO notification once the sender's D-Bus unique name goes away. notify-rust keeps that name alive on the
NotificationHandle.Before this PR, the plugin ran
let _ = notification.show()inside a short-lived task, so the handle and its connection dropped right after theNotifycall and the banner disappeared.Now the task holds the handle by calling
handle.on_close(...), which waits for the server'sNotificationClosedsignal. Apps that never set a callback get an empty one, soshow()still returns right away on both the Rust and JS sides.This also exposes
NotificationBuilder::on_closeon Linux (if that's not in scope, please let me know and I'll remove it).Note that notifications still go away when the app process exits, since that is GNOME's FDO behavior rather than the dropped handle.
Manually tested on:
GDK_BACKEND=x11env var)I have not tested it on Windows but it should be unaffected.