Skip to content

Commit 73b924a

Browse files
committed
ui: Fix backend API to allow empty window handles
1 parent 4db2e7a commit 73b924a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

credentialsd-ui/src/dbus.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use zbus::{
1212
names::{BusName, OwnedUniqueName},
1313
object_server::SignalEmitter,
1414
proxy,
15-
zvariant::ObjectPath,
15+
zvariant::{ObjectPath, Optional},
1616
};
1717

1818
use credentialsd_common::{
@@ -123,7 +123,7 @@ pub struct CredentialPortalBackend {
123123

124124
#[derive(Debug, Clone)]
125125
pub(crate) struct UiContext {
126-
parent_window: WindowHandle,
126+
parent_window: Option<WindowHandle>,
127127
origin: String,
128128
r#type: Operation,
129129
request_id: RequestId,
@@ -142,7 +142,7 @@ impl CredentialPortalBackend {
142142
&self,
143143
#[zbus(header)] header: Header<'_>,
144144
#[zbus(object_server)] object_server: &ObjectServer,
145-
parent_window: WindowHandle,
145+
parent_window: Optional<WindowHandle>,
146146
origin: String,
147147
r#type: Operation,
148148
request_id: RequestId,
@@ -161,7 +161,7 @@ impl CredentialPortalBackend {
161161
request_id
162162
));
163163
let ui_context = UiContext {
164-
parent_window,
164+
parent_window: parent_window.into(),
165165
origin,
166166
r#type,
167167
request_id,
@@ -250,7 +250,7 @@ impl FlowObject {
250250
pid: self.ui_context.app_pid,
251251
},
252252
initial_devices: self.ui_context.devices.clone(),
253-
window_handle: Some(self.ui_context.parent_window.clone()).into(),
253+
window_handle: self.ui_context.parent_window.clone().into(),
254254
},
255255
Arc::new(AsyncMutex::new(flow_control_client)),
256256
);

0 commit comments

Comments
 (0)