Skip to content

Use app title as AppIndicator name on Linux#299

Closed
EricBlanquer wants to merge 1 commit intotauri-apps:devfrom
EricBlanquer:fix/linux-unique-appindicator-name
Closed

Use app title as AppIndicator name on Linux#299
EricBlanquer wants to merge 1 commit intotauri-apps:devfrom
EricBlanquer:fix/linux-unique-appindicator-name

Conversation

@EricBlanquer
Copy link

@EricBlanquer EricBlanquer commented Mar 12, 2026

Summary

On Linux/GTK, the AppIndicator name 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:

  • All apps showing the same generic tooltip
  • Icon collisions when apps share the default temp directory ($XDG_RUNTIME_DIR/tray-icon/)
  • Users unable to distinguish between apps in the system tray

Reported by multiple projects: RustDesk#14165

Fix

Use the title from TrayIconAttributes (if provided) as the AppIndicator name, 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

  • Verified existing tests pass (cargo test)
  • Build succeeds on Linux x86_64

@EricBlanquer
Copy link
Author

Note: a downstream workaround was also submitted for RustDesk in rustdesk/rustdesk#14530 (sets with_title() and with_temp_dir_path() to isolate the tray icon). This upstream fix would make such workarounds unnecessary for all apps using the crate.

@amrbashir
Copy link
Member

amrbashir commented Mar 13, 2026

Thank you, Could you also add a change file in .changes directory?

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.
@EricBlanquer EricBlanquer force-pushed the fix/linux-unique-appindicator-name branch from 157e473 to 6be8fd2 Compare March 13, 2026 08:59
@EricBlanquer
Copy link
Author

Done, added .changes/use-title-as-appindicator-name.md.

@FabianLars
Copy link
Member

FabianLars commented Mar 13, 2026

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.

@EricBlanquer
Copy link
Author

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.

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