add default position for portal streams

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-01-31 17:51:20 +08:00
parent 1a3dcbd275
commit 74a73b7ffd

View File

@ -386,8 +386,8 @@ fn streams_from_response(response: OrgFreedesktopPortalRequestResponse) -> Vec<P
info.size.1 = v[1] as _;
}
}
let v = attributes
.get("position")?
if let Some(pos) = attributes.get("position") {
let v = pos
.as_iter()?
.filter_map(|v| {
Some(
@ -403,6 +403,7 @@ fn streams_from_response(response: OrgFreedesktopPortalRequestResponse) -> Vec<P
info.position.1 = v[1] as _;
}
}
}
Some(info)
})
.collect::<Vec<PwStreamInfo>>(),