Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion credentialsd/src/dbus/ui_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tokio_stream::StreamExt;
use zbus::{
Connection, MatchRule, MessageStream,
fdo::{self, DBusProxy},
names::OwnedUniqueName,
names::{OwnedUniqueName, WellKnownName},
proxy,
zvariant::{ObjectPath, Optional, OwnedFd, OwnedObjectPath},
};
Expand Down Expand Up @@ -400,6 +400,14 @@ impl UiController for UiControlServiceClient {
let (from_ui_tx, from_ui_rx) = mpsc::channel(32);
let backend_proxy = UiControlServiceProxy::new(&self.conn).await?;
let dbus_proxy = DBusProxy::new(&self.conn).await?;
// Calling `create_session()` below would activate the service automatically,
// but we want to subscribe to UI-events before creating a session, and filter
// events according to the sender.
// Therefore, we call `start_service_by_name()` explicitly, then subscribe, then
// issue the function call.
let service_name = WellKnownName::try_from(backend_proxy.as_ref().destination().clone())
.expect("UiControl destination is a well-known name");
dbus_proxy.start_service_by_name(service_name, 0).await?;
let sender = dbus_proxy
.get_name_owner(backend_proxy.as_ref().destination().clone())
.await?;
Expand Down