From 0f34fe39e066144533e61030abbc015ebc9ecb46 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 29 Jun 2026 14:55:11 +0900 Subject: [PATCH] manager: clear known_path when KnownNetwork object is removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forgetting a saved network removes the KnownNetwork D-Bus object, but the matching Network.KnownNetwork change arrives only as a property invalidation, which our changed-only handler drops. As a result n->known_path stayed stale and the ★ marker and Forget (✕) button kept showing until the next full repopulate (radio off/on). Add an IWD_IFACE_KNOWN_NETWORK branch to _on_iface_removed that clears known_path on any network pointing at the removed object, then notifies, so the markers vanish immediately. Co-Authored-By: Claude Opus 4.8 --- src/iwd/iwd_manager.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/iwd/iwd_manager.c b/src/iwd/iwd_manager.c index ec4648e..ac853f1 100644 --- a/src/iwd/iwd_manager.c +++ b/src/iwd/iwd_manager.c @@ -245,6 +245,20 @@ _on_iface_removed(void *data, const char *path, const char *iface) { eina_hash_del(m->networks, path, NULL); } + else if (!strcmp(iface, IWD_IFACE_KNOWN_NETWORK)) + { + /* A saved network was forgotten: iwd removes the KnownNetwork object + * but the matching Network.KnownNetwork change arrives only as an + * invalidation, which our changed-only property handler drops. Clear + * the back-reference here so the ★ marker and Forget (✕) button vanish + * immediately instead of lingering until the next full repopulate. */ + Eina_Iterator *it = eina_hash_iterator_data_new(m->networks); + Iwd_Network *n; + EINA_ITERATOR_FOREACH(it, n) + if (n->known_path && !strcmp(n->known_path, path)) + { free(n->known_path); n->known_path = NULL; } + eina_iterator_free(it); + } else if (!strcmp(iface, IWD_IFACE_ADAPTER)) { eina_hash_del(m->adapters, path, NULL);