status-area: Fix handling of NameOwnerChanged with non-None new name (#1010)

Fixes issue where `fcitx5` app icon persists after it is no longer
running. It seems it was getting a `NameOwnerChanged` event with the
acquired name after `register_status_notifier_item()`.
This commit is contained in:
Ian Douglas Scott 2025-08-04 12:33:55 -07:00 • committed by GitHub
parent d3ef5b181b
commit 1d3d869f4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,6 +118,7 @@ pub async fn create_service(connection: &zbus::Connection) -> zbus::Result<()> {
have_bus_name = false; have_bus_name = false;
} }
} else if let BusName::Unique(name) = &args.name { } else if let BusName::Unique(name) = &args.name {
if args.new_owner.is_none() {
let mut interface = interface.get_mut().await; let mut interface = interface.get_mut().await;
if let Some(idx) = interface if let Some(idx) = interface
.items .items
@ -132,6 +133,7 @@ pub async fn create_service(connection: &zbus::Connection) -> zbus::Result<()> {
} }
} }
} }
}
}); });
Ok(()) Ok(())