From f8f261562ff6500e7388b6523807757f0f79cdcc Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 6 Feb 2025 08:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8Dwayabr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 84 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/main.c b/main.c index a2e74c2d..7eedc080 100644 --- a/main.c +++ b/main.c @@ -2337,51 +2337,51 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) { focused = focustop(monitor); zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon); - // if ((monitor->tagset[monitor->seltags] & TAGMASK) == TAGMASK) { - // state = 0; - // state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; - // zdwl_ipc_output_v2_send_tag(ipc_output->resource, 888, state, 1, 1); - // } else { - // for ( tag = 0 ; tag < LENGTH(tags); tag++) { - // numclients = state = focused_client = 0; - // tagmask = 1 << tag; - // if ((tagmask & monitor->tagset[monitor->seltags]) != 0) - // state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; + if ((monitor->tagset[monitor->seltags] & TAGMASK) == TAGMASK) { + state = 0; + state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; + zdwl_ipc_output_v2_send_tag(ipc_output->resource, 888, state, 1, 1); + } else { + for ( tag = 0 ; tag < LENGTH(tags); tag++) { + numclients = state = focused_client = 0; + tagmask = 1 << tag; + if ((tagmask & monitor->tagset[monitor->seltags]) != 0) + state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; - // wl_list_for_each(c, &clients, link) { - // if (c->mon != monitor) - // continue; - // if (!(c->tags & tagmask)) - // continue; - // if (c == focused) - // focused_client = 1; - // if (c->isurgent) - // state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; + wl_list_for_each(c, &clients, link) { + if (c->mon != monitor) + continue; + if (!(c->tags & tagmask)) + continue; + if (c == focused) + focused_client = 1; + if (c->isurgent) + state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; - // numclients++; - // } - // zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); - // } - // } + numclients++; + } + zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); + } + } - for ( tag = 0 ; tag < LENGTH(tags); tag++) { - numclients = state = focused_client = 0; - tagmask = 1 << tag; - if ((tagmask & monitor->tagset[monitor->seltags]) != 0) - state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; - wl_list_for_each(c, &clients, link) { - if (c->mon != monitor) - continue; - if (!(c->tags & tagmask)) - continue; - if (c == focused) - focused_client = 1; - if (c->isurgent) - state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; - numclients++; - } - zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); - } + // for ( tag = 0 ; tag < LENGTH(tags); tag++) { + // numclients = state = focused_client = 0; + // tagmask = 1 << tag; + // if ((tagmask & monitor->tagset[monitor->seltags]) != 0) + // state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; + // wl_list_for_each(c, &clients, link) { + // if (c->mon != monitor) + // continue; + // if (!(c->tags & tagmask)) + // continue; + // if (c == focused) + // focused_client = 1; + // if (c->isurgent) + // state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; + // numclients++; + // } + // zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); + // } title = focused ? client_get_title(focused) : ""; appid = focused ? client_get_appid(focused) : "";