Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the same StatusNotifierWatcher for all trays #598

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

layus
Copy link
Contributor

@layus layus commented Feb 19, 2020

Fixes #359

This uses a singleton so we only ever use one StatusNotifierWatcher for
all of our bars (and all of their trays).

Before we had one per tray module. The first one to get the DBus name
would prevent the others from getting it. When that tray disappears (due
to dpms toggles for example), the other watchers do not react to it
correctly. Plus, I am not even sure that it is correct for the same
process to try to acquire the same name multiple times.

This does not solve the fact that we should be able to lose the
name and get it back on the bus, but at least we are not deceiving
ourselves :).

@@ -23,6 +22,7 @@ Watcher::~Watcher() {
g_slist_free_full(items_, gfWatchFree);
items_ = nullptr;
}
Gio::DBus::unown_name(bus_name_id_);
Copy link
Owner

Choose a reason for hiding this comment

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

It's not already the case when it's destroyed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is it destroyed ? I worked on the assumption that (bus_name_id_) is only an int, and therefore RAII does not apply.

Copy link
Owner

Choose a reason for hiding this comment

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

Ok you're right, I assumed that Gio::DBus::own_name will do it, but no.

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.

tray lost after dpms toggle
2 participants