fix(sni): silence duplicate item registration warnings

Some tray items re-register the same bus name and object path during normal
operation. Treat that path as an idempotent registration instead of logging a
warning, while still completing the DBus method successfully.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2026-03-08 01:16:25 -06:00
parent f6d92fd708
commit 8e2e437ec6

View File

@@ -98,8 +98,8 @@ gboolean Watcher::handleRegisterItem(Watcher* obj, GDBusMethodInvocation* invoca
} }
auto watch = gfWatchFind(obj->items_, bus_name, object_path); auto watch = gfWatchFind(obj->items_, bus_name, object_path);
if (watch != nullptr) { if (watch != nullptr) {
g_warning("Status Notifier Item with bus name '%s' and object path '%s' is already registered", spdlog::debug("Ignoring duplicate Status Notifier Item registration for '{}' at '{}'", bus_name,
bus_name, object_path); object_path);
sn_watcher_complete_register_item(obj->watcher_, invocation); sn_watcher_complete_register_item(obj->watcher_, invocation);
return TRUE; return TRUE;
} }