1
0
Fork 0
forked from wry/wry

portal: include mapping_id in screencasts

This commit is contained in:
Julian Orth 2024-10-11 13:23:54 +02:00
parent edafe16742
commit 5df018046c
5 changed files with 31 additions and 5 deletions

View file

@ -90,7 +90,7 @@ impl UsrJayEiSessionOwner for StartingRemoteDesktop {
Some(self.dpy.clone()),
);
} else {
self.session.send_start_reply(None, None);
self.session.send_start_reply(None, None, None);
}
}

View file

@ -159,8 +159,19 @@ bitflags! {
impl PwClientNodeOwner for StartingScreencast {
fn bound_id(&self, node_id: u32) {
self.session
.send_start_reply(Some(node_id), create_restore_data(&self.dpy, &self.target));
{
let output = match &self.target {
ScreencastTarget::Output(o) => Some(o),
ScreencastTarget::Workspace(o, _, _) => Some(o),
ScreencastTarget::Toplevel(_) => None,
};
let mapping_id = output.and_then(|o| o.wl.name.borrow().clone());
self.session.send_start_reply(
Some(node_id),
create_restore_data(&self.dpy, &self.target),
mapping_id.as_deref(),
);
}
let mut supported_formats = PwClientNodePortSupportedFormats {
media_type: Some(SPA_MEDIA_TYPE_video),
media_sub_type: Some(SPA_MEDIA_SUBTYPE_raw),

View file

@ -100,6 +100,7 @@ impl PortalSession {
&self,
pw_node_id: Option<u32>,
restore_data: Option<Variant<'static>>,
mapping_id: Option<&str>,
) {
let inner_type = DynamicType::DictEntry(
Box::new(DynamicType::String),
@ -133,6 +134,12 @@ impl PortalSession {
value: rd,
});
}
if let Some(mapping_id) = mapping_id {
variants.push(DictEntry {
key: "mapping_id".into(),
value: Variant::String(mapping_id.into()),
});
}
if let Some(reply) = self.start_reply.take() {
match reply {
PortalSessionReply::RemoteDesktop(reply) => {