Skip to content

Fix Tray: prevent icon duplication#731

Open
SimoneFelici wants to merge 2 commits intoMalpenZibo:mainfrom
SimoneFelici:main
Open

Fix Tray: prevent icon duplication#731
SimoneFelici wants to merge 2 commits intoMalpenZibo:mainfrom
SimoneFelici:main

Conversation

@SimoneFelici
Copy link
Copy Markdown
Contributor

Hi,
this PR fixes my issue: #593
feel free to ask some question about the issue,
I've tested this fix with various tray icons on my system and everything works.

@github-actions github-actions Bot added the bug Something isn't working label May 6, 2026
@romanstingler
Copy link
Copy Markdown
Collaborator

thanks for the contribution
please fix the formatting
just run make check which runs

❯ make check
cargo fmt
cargo check
   Compiling ashell v0.8.0 (/srv/opensource/ashell)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.92s
cargo clippy -- -D warnings
    Checking ashell v0.8.0 (/srv/opensource/ashell)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.35s

@clotodex are you using tray apps lately ??

@SimoneFelici
Copy link
Copy Markdown
Contributor Author

SimoneFelici commented May 6, 2026

thanks for the contribution please fix the formatting just run make check which runs

Ops, sorry.
I've run make check.

Copy link
Copy Markdown
Owner

@MalpenZibo MalpenZibo left a comment

Choose a reason for hiding this comment

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

Can you try this other solution? I suspect that we're moving the bug instead of resolving it.

Comment thread src/services/tray/dbus.rs
Comment on lines 143 to 148
) {
let service = if service.starts_with('/') {
format!("{sender}{service}")
} else {
service.to_string()
};
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's add this check

Suggested change
) {
if self.items.iter().any(|(s, _)| s == &sender) {
return;
}
let service = if service.starts_with('/') {
format!("{sender}{service}")
} else {
service.to_string()
};

Comment thread src/services/tray/dbus.rs
Comment on lines 150 to 152
if self.items.iter().any(|(_, s)| s == &service) {
return;
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's remove this check

Suggested change

Comment thread src/services/tray/dbus.rs
sender.into_inner(),
&emitter,
)
.register_status_notifier_item_manual(name_str, sender.into_inner(), &emitter)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Instead of this change, can you try modifying the check in the register_status_notifier_item_manual?

@SimoneFelici
Copy link
Copy Markdown
Contributor Author

Can you try this other solution? I suspect that we're moving the bug instead of resolving it.

Thank you, this also work,
Should I commit this newer version?

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants