1
0
Fork 0
forked from wry/wry

cli: handle WAYLAND_DISPLAY already being privileged

This commit is contained in:
Julian Orth 2026-03-23 20:34:32 +01:00
parent 2dbf6aa483
commit e9708b1184

View file

@ -30,6 +30,7 @@ use {
},
},
ahash::AHashMap,
isnt::std_1::primitive::IsntSliceExt,
std::{
cell::{Cell, RefCell},
collections::VecDeque,
@ -155,7 +156,11 @@ impl ToolClient {
Ok(d) => d,
Err(_) => return Err(ToolClientError::WaylandDisplayNotSet),
};
let path = format_ustr!("{}/{}.jay", xrd, wd);
let mut path = format_ustr!("{}/{}", xrd, wd);
let suffix = b".jay";
if path.not_ends_with(suffix) {
path.push(suffix.as_slice());
}
let socket = match uapi::socket(c::AF_UNIX, c::SOCK_STREAM | c::SOCK_CLOEXEC, 0) {
Ok(s) => Rc::new(s),
Err(e) => return Err(ToolClientError::CreateSocket(e.into())),