Clear Background portal state when compositor IPC disconnects

Notify consumers when cached apps disappear and repopulate state from the next compositor snapshot. Cover disconnects, reconnects and duplicate signals on a private D-Bus session, and run the regression in CI.

Fixes #56
This commit is contained in:
Samuel Onoja committed 2026-10-20 15:36:45 +01:00
1 parent afd46c0ea5
commit 4fb383eaa3
3 files changed
+167

No files matched your search

+11
View File
@@ -149,6 +149,17 @@ impl Background {
}
}
.await;
// An interrupted generation is no longer authoritative. Clear it
// before waiting to reconnect, and signal only an actual change.
let had_apps = {
let mut states = self.states.write().await;
let had_apps = !states.is_empty();
states.clear();
had_apps
};
if had_apps {
let _ = Self::running_applications_changed(&emitter).await;
}
if let Err(error) = result {
eprintln!("ferese portal: background event stream: {error}");
}