From 596909cd2565fb957538fc0d81b0c16222a77cf4 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 27 Feb 2026 20:55:45 +0100 Subject: [PATCH] cli: print client tags --- src/cli/clients.rs | 5 +++++ src/ifs/jay_client_query.rs | 12 +++++++++++- src/ifs/jay_compositor.rs | 2 +- src/security_context_acceptor.rs | 1 - src/tools/tool_client.rs | 2 +- wire/jay_client_query.txt | 4 ++++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/cli/clients.rs b/src/cli/clients.rs index cd6f268a..64e1c8b3 100644 --- a/src/cli/clients.rs +++ b/src/cli/clients.rs @@ -157,6 +157,7 @@ pub struct Client { pub is_xwayland: bool, pub comm: Option, pub exe: Option, + pub tag: Option, } pub async fn handle_client_query( @@ -201,6 +202,9 @@ pub async fn handle_client_query( Exe::handle(tl, id, c.clone(), |c, event| { 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; mem::take(&mut *c.borrow_mut()) .into_iter() @@ -239,5 +243,6 @@ impl ClientPrinter<'_> { bol!(is_xwayland, "xwayland"); opt!(comm, "comm"); opt!(exe, "exe"); + opt!(tag, "tag"); } } diff --git a/src/ifs/jay_client_query.rs b/src/ifs/jay_client_query.rs index 2a20e109..bba06f2b 100644 --- a/src/ifs/jay_client_query.rs +++ b/src/ifs/jay_client_query.rs @@ -9,7 +9,7 @@ use { jay_client_query::{ AddAll, AddId, Comm, Destroy, Done, End, Exe, Execute, IsXwayland, JayClientQueryRequestHandler, Pid, SandboxAppId, SandboxEngine, SandboxInstanceId, - Sandboxed, Start, Uid, + Sandboxed, Start, Tag, Uid, }, }, }, @@ -26,6 +26,8 @@ pub struct JayClientQuery { all: Cell, } +const TAG_SINCE: Version = Version(25); + impl JayClientQuery { pub fn new(client: &Rc, id: JayClientQueryId, version: Version) -> Self { Self { @@ -95,6 +97,14 @@ impl JayClientQueryRequestHandler for JayClientQuery { 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 }); }; if self.all.get() { diff --git a/src/ifs/jay_compositor.rs b/src/ifs/jay_compositor.rs index 611ab54c..40ca1f1d 100644 --- a/src/ifs/jay_compositor.rs +++ b/src/ifs/jay_compositor.rs @@ -79,7 +79,7 @@ impl Global for JayCompositorGlobal { } fn version(&self) -> u32 { - 24 + 25 } fn required_caps(&self) -> ClientCaps { diff --git a/src/security_context_acceptor.rs b/src/security_context_acceptor.rs index 6df64edd..0a5f9bb0 100644 --- a/src/security_context_acceptor.rs +++ b/src/security_context_acceptor.rs @@ -39,7 +39,6 @@ pub struct AcceptorMetadata { pub sandbox_engine: Option, pub app_id: Option, pub instance_id: Option, - #[expect(dead_code)] pub tag: Option, } diff --git a/src/tools/tool_client.rs b/src/tools/tool_client.rs index 32b307ec..0b720d5c 100644 --- a/src/tools/tool_client.rs +++ b/src/tools/tool_client.rs @@ -335,7 +335,7 @@ impl ToolClient { self_id: s.registry, name: s.jay_compositor.0, interface: JayCompositor.name(), - version: s.jay_compositor.1.min(24), + version: s.jay_compositor.1.min(25), id: id.into(), }); self.jay_compositor.set(Some(id)); diff --git a/wire/jay_client_query.txt b/wire/jay_client_query.txt index ef841292..f2f97d05 100644 --- a/wire/jay_client_query.txt +++ b/wire/jay_client_query.txt @@ -47,3 +47,7 @@ event comm { event exe { exe: str, } + +event tag (since = 25) { + tag: str, +}