[PR #17] [MERGED] client.rs: remove items from 'items' variable when receiving remove e… #20

Closed
opened 2026-05-22 22:04:51 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/system-tray/pull/17
Author: @Levizor
Created: 2/5/2025
Status: Merged
Merged: 2/5/2025
Merged by: @JakeStanger

Base: masterHead: items-remove-fix


📝 Commits (1)

  • 3e33b42 client.rs: remove items from 'items' variable when receiving remove event

📊 Changes

1 file changed (+13 additions, -2 deletions)

View changed files

📝 src/client.rs (+13 -2)

📄 Description

Client contains items field which stores all the tray items in a HashMap.
Upon receiving a new item client adds it to the mentioned map, so I assume that this map should be synchronized with the real state of the tray. However, when we receive a remove update, the item isn't cleaned from the map, which I find strange. I also don't see updates supplied to this map, so maybe it should be as well implemented.

So my suggestions is to remove items when we receive respective update. If you open and close an application that adds items to a tray now, it will be duplicated over and over, which is clearly not intended.

This problem was mentioned in this issue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/system-tray/pull/17 **Author:** [@Levizor](https://github.com/Levizor) **Created:** 2/5/2025 **Status:** ✅ Merged **Merged:** 2/5/2025 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `items-remove-fix` --- ### 📝 Commits (1) - [`3e33b42`](https://github.com/JakeStanger/system-tray/commit/3e33b424b774d98cdc61f52ac1baa22d09c07e33) client.rs: remove items from 'items' variable when receiving remove event ### 📊 Changes **1 file changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/client.rs` (+13 -2) </details> ### 📄 Description Client contains items field which stores all the tray items in a HashMap. Upon receiving a new item client adds it to the mentioned map, so I assume that this map should be synchronized with the real state of the tray. However, when we receive a remove update, the item isn't cleaned from the map, which I find strange. I also don't see updates supplied to this map, so maybe it should be as well implemented. So my suggestions is to remove items when we receive respective update. If you open and close an application that adds items to a tray now, it will be duplicated over and over, which is clearly not intended. This problem was mentioned in this [issue](https://github.com/JakeStanger/system-tray/issues/15). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-22 22:04:51 +01:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/system-tray#20
No description provided.