From 33eda01a07d154dd4ffce1534429cc3dce896fe4 Mon Sep 17 00:00:00 2001 From: dashdashRod <39976286+dashdashRod@users.noreply.github.com> Date: Fri, 1 May 2026 14:28:50 -0300 Subject: [PATCH] feat(ipc): add per-client tag event to zdwl_ipc_output_v2 v3 Adds `client` event reporting appid/title/tagmask once per managed client per output during state-update batches. Closes the gap where consumers could see per-tag client counts but not per-tag client identities. Bumps zdwl_ipc_output_v2 interface to v3 and zdwl_ipc_manager_v2 global advertisement to v3. Implementation localized to dwl_ipc_output_printstatus_to in src/ext-protocol/dwl-ipc.h. --- protocols/dwl-ipc-unstable-v2.xml | 15 +++++++++++++-- src/ext-protocol/dwl-ipc.h | 15 +++++++++++++++ src/mango.c | 3 ++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/protocols/dwl-ipc-unstable-v2.xml b/protocols/dwl-ipc-unstable-v2.xml index 5852107e..868d7ae0 100644 --- a/protocols/dwl-ipc-unstable-v2.xml +++ b/protocols/dwl-ipc-unstable-v2.xml @@ -19,7 +19,7 @@ I would probably just submit raphi's patchset but I don't think that would be po reset. - + This interface is exposed as a global in wl_registry. @@ -60,7 +60,7 @@ I would probably just submit raphi's patchset but I don't think that would be po - + Observe and control a dwl output. @@ -128,6 +128,17 @@ I would probably just submit raphi's patchset but I don't think that would be po + + + Reports a single managed client on this output, with its appid, title, + and tag bitmask. Fired once per client per state-update batch, after + all tag events and before frame. + + + + + + Indicates the layout has changed. Since layout symbols are dynamic. diff --git a/src/ext-protocol/dwl-ipc.h b/src/ext-protocol/dwl-ipc.h index ab0bdb8d..f6fca18b 100644 --- a/src/ext-protocol/dwl-ipc.h +++ b/src/ext-protocol/dwl-ipc.h @@ -212,6 +212,21 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) { } zdwl_ipc_output_v2_send_frame(ipc_output->resource); + + //recently added + if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_CLIENT_SINCE_VERSION) { + const char *c_appid, *c_title; + wl_list_for_each(c, &clients, link) { + if (c->mon != monitor) + continue; + c_appid = client_get_appid(c); + c_title = client_get_title(c); + zdwl_ipc_output_v2_send_client(ipc_output->resource, + c_appid ? c_appid : broken, + c_title ? c_title : broken, + c->tags); + } + } } void dwl_ipc_output_set_client_tags(struct wl_client *client, diff --git a/src/mango.c b/src/mango.c index 85fc00ac..62702c93 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5802,7 +5802,8 @@ void setup(void) { wlr_log(WLR_INFO, "VR will not be available."); } - wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, + + wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 3, NULL, dwl_ipc_manager_bind); // 创建顶层管理句柄