[GH-ISSUE #15] Multiple instance? #5

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

Originally created by @ogios on GitHub (Jan 31, 2025).
Original GitHub issue: https://github.com/JakeStanger/system-tray/issues/15

i see this after i reload my widgets, which calls client.items()
this is weird...

i do call nm-applet and xwaylandvideobridge a lot of times to test, but i've killed the process after the test and this does not happen before i reload my widgets.

Image

Originally created by @ogios on GitHub (Jan 31, 2025). Original GitHub issue: https://github.com/JakeStanger/system-tray/issues/15 i see this after i reload my widgets, which calls `client.items()` this is weird... i do call nm-applet and xwaylandvideobridge a lot of times to test, but i've killed the process after the test and this does not happen before i reload my widgets. ![Image](https://github.com/user-attachments/assets/ecf127ba-9d57-439d-8907-bfacc3202852)
Author
Owner

@JakeStanger commented on GitHub (Jan 31, 2025):

Likely related to this issue in Ironbar: https://github.com/JakeStanger/ironbar/issues/854

I suspect something to do with reloading is causing items to be re-fetched without being correctly dropped first.

<!-- gh-comment-id:2627028503 --> @JakeStanger commented on GitHub (Jan 31, 2025): Likely related to this issue in Ironbar: https://github.com/JakeStanger/ironbar/issues/854 I suspect something to do with reloading is causing items to be re-fetched without being correctly dropped first.
Author
Owner

@ogios commented on GitHub (Feb 5, 2025):

maybe we can let user to maintain the item themselves, it saves memory if user has to process the data after an event.

make item a feature, user can still use it when adding data in features?

/// Client for watching the tray.
#[derive(Debug)]
pub struct Client {
    tx: broadcast::Sender<Event>,
    _rx: broadcast::Receiver<Event>,
    connection: Connection,

    #[cfg(feature = "data")]
    items: Arc<Mutex<State>>,
}
<!-- gh-comment-id:2635654150 --> @ogios commented on GitHub (Feb 5, 2025): maybe we can let user to maintain the item themselves, it saves memory if user has to process the data after an event. make item a feature, user can still use it when adding `data` in features? ```rust /// Client for watching the tray. #[derive(Debug)] pub struct Client { tx: broadcast::Sender<Event>, _rx: broadcast::Receiver<Event>, connection: Connection, #[cfg(feature = "data")] items: Arc<Mutex<State>>, } ```
Author
Owner

@JakeStanger commented on GitHub (Feb 5, 2025):

I am assuming that #17 fixes this. If it doesn't, let me know and I can re-open.

We could potentially put the internal items map behind a feature flag to reduce memory, I'd be happy for that to be added.

<!-- gh-comment-id:2637575082 --> @JakeStanger commented on GitHub (Feb 5, 2025): I am assuming that #17 fixes this. If it doesn't, let me know and I can re-open. We could potentially put the internal items map behind a feature flag to reduce memory, I'd be happy for that to be added.
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#5
No description provided.