1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-09-18 12:46:58 +02:00

fix(networkmanager): remove icons for removed devices

This commit is contained in:
Reinout Meliesie 2025-09-04 14:25:20 +02:00
commit af49acb40b
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
2 changed files with 20 additions and 3 deletions

View file

@ -113,7 +113,6 @@ impl ClientInner {
watchers.insert(added_device_path.clone(), watcher);
}
// TODO: Inform module of removed devices
let removed_device_paths = device_paths.difference(&new_device_paths);
for removed_device_path in removed_device_paths {
let watcher = watchers
@ -122,6 +121,13 @@ impl ClientInner {
watcher.state_watcher.abort();
watchers.remove(removed_device_path);
// TODO: Replace the identifier sent to modules with the dbus device number (last segment of its path)
let dbus_connection = &self.dbus_connection().await?;
let device = DeviceDbusProxy::new(dbus_connection, removed_device_path).await?;
let interface = device.interface().await?.to_string();
self.controller_sender
.send(ClientToModuleEvent::DeviceRemoved { interface })?;
debug!("D-bus device watchers for {} stopped", removed_device_path);
}
}