Fix desktop notifications on GNOME 46+ Linux#1246
Open
benthecarman wants to merge 1 commit into
Open
Conversation
0088bf0 to
744bf74
Compare
Collaborator
|
Blocking: [target.'cfg(target_os = "linux")'.dependencies]Cargo rejects duplicate TOML tables before it can compile, so the desktop crate fails immediately with: This is from adding the |
The app posts every desktop notification through the Web Notification constructor, which tauri-plugin-notification routes to its `notify` command. That command calls notify-rust's `show()` and then drops the returned handle immediately. The handle owns the D-Bus connection used to post the notification, and on GNOME 46+ (Ubuntu 24.04, Fedora 41+) tearing that connection down dismisses the notification the instant it appears, so nothing is ever seen. macOS uses a different backend and is unaffected. Add a Linux-only `show_native_notification` command that posts from a dedicated thread and holds the connection open via `wait_for_action` until the notification is closed. The same wait surfaces the default click action, which is forwarded to the frontend so clicking focuses the window and routes to the notification target. The web client now sends through this command on Linux and keeps the plugin path on macOS and Windows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: benthecarman <benthecarman@live.com>
744bf74 to
9b30e6e
Compare
Contributor
Author
|
@wesbillman sorry, was not on latest master. Fixed! |
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.
Desktop notifications didn't work for me. Claude's vibe coded fix. This fixes the problem for me
The app posts every desktop notification through the Web Notification constructor, which tauri-plugin-notification routes to its
notifycommand. That command calls notify-rust'sshow()and then drops the returned handle immediately. The handle owns the D-Bus connection used to post the notification, and on GNOME 46+ (Ubuntu 24.04, Fedora 41+) tearing that connection down dismisses the notification the instant it appears, so nothing is ever seen. macOS uses a different backend and is unaffected.Add a Linux-only
show_native_notificationcommand that posts from a dedicated thread and holds the connection open viawait_for_actionuntil the notification is closed. The same wait surfaces the default click action, which is forwarded to the frontend so clicking focuses the window and routes to the notification target. The web client now sends through this command on Linux and keeps the plugin path on macOS and Windows.