Skip to content

fix: keep GNOME notifications open (fix #2566) - #3588

Open
The-Best-Codes wants to merge 5 commits into
tauri-apps:v2from
The-Best-Codes:best/fix-gnome-notifications
Open

The-Best-Codes wants to merge 5 commits into
tauri-apps:v2from
The-Best-Codes:best/fix-gnome-notifications

Conversation

@The-Best-Codes

@The-Best-Codes The-Best-Codes commented Sep 15, 2026

Copy link
Copy Markdown

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 the Notify call and the banner disappeared.
Now the task holds the handle by calling handle.on_close(...), which waits for the server's NotificationClosed signal. Apps that never set a callback get an empty one, so show() still returns right away on both the Rust and JS sides.

This also exposes NotificationBuilder::on_close on 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:

  • Arch Linux
    • Gnome 50 using Wayland
    • Gnome 50 using X11 (via GDK_BACKEND=x11 env var)
  • macOS 27 (unaffected)

I have not tested it on Windows but it should be unaffected.

Signed-off-by: BestCodes <106822363+The-Best-Codes@users.noreply.github.com>
@The-Best-Codes
The-Best-Codes marked this pull request as ready for review September 15, 2026 21:04
@The-Best-Codes
The-Best-Codes requested a review from a team as a code owner September 15, 2026 21:04
Signed-off-by: BestCodes <106822363+The-Best-Codes@users.noreply.github.com>

@The-Best-Codes The-Best-Codes left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] no notifications in gnome 46+ (eg fedora 41 and ubuntu 24.04)

2 participants