cli: print client tags
This commit is contained in:
parent
75400e672d
commit
596909cd25
6 changed files with 22 additions and 4 deletions
|
|
@ -157,6 +157,7 @@ pub struct Client {
|
||||||
pub is_xwayland: bool,
|
pub is_xwayland: bool,
|
||||||
pub comm: Option<String>,
|
pub comm: Option<String>,
|
||||||
pub exe: Option<String>,
|
pub exe: Option<String>,
|
||||||
|
pub tag: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_client_query(
|
pub async fn handle_client_query(
|
||||||
|
|
@ -201,6 +202,9 @@ pub async fn handle_client_query(
|
||||||
Exe::handle(tl, id, c.clone(), |c, event| {
|
Exe::handle(tl, id, c.clone(), |c, event| {
|
||||||
last!(c).exe = Some(event.exe.to_string());
|
last!(c).exe = Some(event.exe.to_string());
|
||||||
});
|
});
|
||||||
|
Tag::handle(tl, id, c.clone(), |c, event| {
|
||||||
|
last!(c).tag = Some(event.tag.to_string());
|
||||||
|
});
|
||||||
tl.round_trip().await;
|
tl.round_trip().await;
|
||||||
mem::take(&mut *c.borrow_mut())
|
mem::take(&mut *c.borrow_mut())
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
@ -239,5 +243,6 @@ impl ClientPrinter<'_> {
|
||||||
bol!(is_xwayland, "xwayland");
|
bol!(is_xwayland, "xwayland");
|
||||||
opt!(comm, "comm");
|
opt!(comm, "comm");
|
||||||
opt!(exe, "exe");
|
opt!(exe, "exe");
|
||||||
|
opt!(tag, "tag");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use {
|
||||||
jay_client_query::{
|
jay_client_query::{
|
||||||
AddAll, AddId, Comm, Destroy, Done, End, Exe, Execute, IsXwayland,
|
AddAll, AddId, Comm, Destroy, Done, End, Exe, Execute, IsXwayland,
|
||||||
JayClientQueryRequestHandler, Pid, SandboxAppId, SandboxEngine, SandboxInstanceId,
|
JayClientQueryRequestHandler, Pid, SandboxAppId, SandboxEngine, SandboxInstanceId,
|
||||||
Sandboxed, Start, Uid,
|
Sandboxed, Start, Tag, Uid,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -26,6 +26,8 @@ pub struct JayClientQuery {
|
||||||
all: Cell<bool>,
|
all: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TAG_SINCE: Version = Version(25);
|
||||||
|
|
||||||
impl JayClientQuery {
|
impl JayClientQuery {
|
||||||
pub fn new(client: &Rc<Client>, id: JayClientQueryId, version: Version) -> Self {
|
pub fn new(client: &Rc<Client>, id: JayClientQueryId, version: Version) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -95,6 +97,14 @@ impl JayClientQueryRequestHandler for JayClientQuery {
|
||||||
instance_id,
|
instance_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if self.version >= TAG_SINCE
|
||||||
|
&& let Some(tag) = &client.acceptor.tag
|
||||||
|
{
|
||||||
|
self.client.event(Tag {
|
||||||
|
self_id: self.id,
|
||||||
|
tag,
|
||||||
|
});
|
||||||
|
}
|
||||||
self.client.event(End { self_id: self.id });
|
self.client.event(End { self_id: self.id });
|
||||||
};
|
};
|
||||||
if self.all.get() {
|
if self.all.get() {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ impl Global for JayCompositorGlobal {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn version(&self) -> u32 {
|
fn version(&self) -> u32 {
|
||||||
24
|
25
|
||||||
}
|
}
|
||||||
|
|
||||||
fn required_caps(&self) -> ClientCaps {
|
fn required_caps(&self) -> ClientCaps {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ pub struct AcceptorMetadata {
|
||||||
pub sandbox_engine: Option<String>,
|
pub sandbox_engine: Option<String>,
|
||||||
pub app_id: Option<String>,
|
pub app_id: Option<String>,
|
||||||
pub instance_id: Option<String>,
|
pub instance_id: Option<String>,
|
||||||
#[expect(dead_code)]
|
|
||||||
pub tag: Option<String>,
|
pub tag: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ impl ToolClient {
|
||||||
self_id: s.registry,
|
self_id: s.registry,
|
||||||
name: s.jay_compositor.0,
|
name: s.jay_compositor.0,
|
||||||
interface: JayCompositor.name(),
|
interface: JayCompositor.name(),
|
||||||
version: s.jay_compositor.1.min(24),
|
version: s.jay_compositor.1.min(25),
|
||||||
id: id.into(),
|
id: id.into(),
|
||||||
});
|
});
|
||||||
self.jay_compositor.set(Some(id));
|
self.jay_compositor.set(Some(id));
|
||||||
|
|
|
||||||
|
|
@ -47,3 +47,7 @@ event comm {
|
||||||
event exe {
|
event exe {
|
||||||
exe: str,
|
exe: str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event tag (since = 25) {
|
||||||
|
tag: str,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue