Use app title as AppIndicator name on Linux#299
Use app title as AppIndicator name on Linux#299EricBlanquer wants to merge 1 commit intotauri-apps:devfrom
Conversation
|
Note: a downstream workaround was also submitted for RustDesk in rustdesk/rustdesk#14530 (sets |
|
Thank you, Could you also add a change file in |
On Linux/GTK, the AppIndicator name was hardcoded to
"tray-icon tray app {id}", causing all apps using this crate
to appear with the same generic identity in the system tray.
Use the title provided via TrayIconAttributes (if set) as the
AppIndicator name, falling back to "tray-icon-{id}" otherwise.
This gives each app a unique indicator identity and prevents
icon collisions when multiple apps share the same tray-icon
temp directory.
157e473 to
6be8fd2
Compare
|
Done, added |
|
This feels like a worse alternative of #290 which should also completely fix RustDesk's issue if they had just updated tray-icon (they're on 0.14.3 - we're on 0.21.3) https://github.com/rustdesk/rustdesk/blob/96797742f27b475e018f161f6a365a9f235483e6/Cargo.lock#L8941-L8943 Edit: Not sure if alternative is a good word considering that this would re-introduce the duplication issue if 2 apps use the same title as it disabled the id based fix from the linked PR. |
|
You're right, thanks for pointing out #290. The id-from-pid fix already solves the icon file collision issue. RustDesk's problem is simply that they're on 0.14.3 — updating to 0.21.3 would fix it. Closing this PR as the proper fix is already in place. |
Summary
On Linux/GTK, the
AppIndicatorname is hardcoded to"tray-icon tray app {id}"(src/platform_impl/gtk/mod.rs:25), causing all apps using this crate to share the same generic identity in the system tray.This leads to:
$XDG_RUNTIME_DIR/tray-icon/)Reported by multiple projects: RustDesk#14165
Fix
Use the
titlefromTrayIconAttributes(if provided) as theAppIndicatorname, falling back to"tray-icon-{id}"otherwise. This gives each app a unique indicator identity without requiring any API change — apps that already call.with_title()will automatically get a proper indicator name.Related
Downstream workaround submitted for RustDesk: rustdesk/rustdesk#14530
Test plan
cargo test)