forked from quickshell/quickshell
service/tray: report misbehaving tray hosts
I've debugged broken tray items that just end up being a bad host far too many times.
This commit is contained in:
parent
0445eee33a
commit
36d1dbeb69
6 changed files with 25 additions and 2 deletions
|
@ -47,12 +47,15 @@ StatusNotifierWatcher::StatusNotifierWatcher(QObject* parent): QObject(parent) {
|
|||
this->tryRegister();
|
||||
}
|
||||
|
||||
bool StatusNotifierWatcher::isRegistered() const { return this->registered; }
|
||||
|
||||
void StatusNotifierWatcher::tryRegister() { // NOLINT
|
||||
auto bus = QDBusConnection::sessionBus();
|
||||
auto success = bus.registerService("org.kde.StatusNotifierWatcher");
|
||||
|
||||
if (success) {
|
||||
qCDebug(logStatusNotifierWatcher) << "Registered watcher at org.kde.StatusNotifierWatcher";
|
||||
this->registered = true;
|
||||
} else {
|
||||
qCDebug(logStatusNotifierWatcher)
|
||||
<< "Could not register watcher at org.kde.StatusNotifierWatcher, presumably because one is "
|
||||
|
@ -68,7 +71,6 @@ void StatusNotifierWatcher::onServiceUnregistered(const QString& service) {
|
|||
<< "Active StatusNotifierWatcher unregistered, attempting registration";
|
||||
this->tryRegister();
|
||||
return;
|
||||
;
|
||||
} else {
|
||||
QString qualifiedItem;
|
||||
this->items.removeIf([&](const QString& item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue