properly fix screenshare portal
This commit is contained in:
parent
e61f042d8b
commit
4680fc8dbc
2 changed files with 15 additions and 4 deletions
|
|
@ -3,4 +3,4 @@ default=gtk
|
||||||
org.freedesktop.impl.portal.ScreenCast=jay
|
org.freedesktop.impl.portal.ScreenCast=jay
|
||||||
org.freedesktop.impl.portal.RemoteDesktop=jay
|
org.freedesktop.impl.portal.RemoteDesktop=jay
|
||||||
org.freedesktop.impl.portal.Inhibit=none
|
org.freedesktop.impl.portal.Inhibit=none
|
||||||
org.freedesktop.impl.portal.FileChooser=gtk4
|
org.freedesktop.impl.portal.FileChooser=gtk
|
||||||
|
|
|
||||||
|
|
@ -286,17 +286,28 @@ impl UsrJayOutputOwner for PortalOutput {
|
||||||
|
|
||||||
impl UsrWlOutputOwner for PortalOutput {}
|
impl UsrWlOutputOwner for PortalOutput {}
|
||||||
|
|
||||||
async fn maybe_add_display(state: &Rc<PortalState>, name: &str) {
|
fn parse_display_name(name: &str) -> Option<u32> {
|
||||||
let tail = match name.strip_prefix("wayland-") {
|
let tail = match name.strip_prefix("wayland-") {
|
||||||
Some(t) => t,
|
Some(t) => t,
|
||||||
_ => return,
|
_ => return None,
|
||||||
};
|
};
|
||||||
let head = match tail.strip_suffix(".jay") {
|
let head = match tail.strip_suffix(".jay") {
|
||||||
Some(h) => h,
|
Some(h) => h,
|
||||||
_ => return,
|
_ => tail,
|
||||||
};
|
};
|
||||||
let num = match u32::from_str(head) {
|
let num = match u32::from_str(head) {
|
||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
|
_ => return None,
|
||||||
|
};
|
||||||
|
if !(1..1000).contains(&num) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(num)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn maybe_add_display(state: &Rc<PortalState>, name: &str) {
|
||||||
|
let num = match parse_display_name(name) {
|
||||||
|
Some(n) => n,
|
||||||
_ => return,
|
_ => return,
|
||||||
};
|
};
|
||||||
let path = format!("{}/{}", state.xrd, name);
|
let path = format!("{}/{}", state.xrd, name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue