mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-07 13:29:59 -05:00
opt: optimize tag animation init offset
This commit is contained in:
parent
f3707fd894
commit
9bd85a8298
1 changed files with 44 additions and 44 deletions
58
main.c
58
main.c
|
|
@ -1122,9 +1122,9 @@ arrange(Monitor *m,bool want_animation)
|
|||
if (!c->animation.from_rule && want_animation && m->pertag->prevtag !=0 && m->pertag->curtag !=0) {
|
||||
c->animation.tagining = true;
|
||||
if (m->pertag->curtag > m->pertag->prevtag) {
|
||||
c->animainit_geom.x = c->geom.x + m->m.width;
|
||||
c->animainit_geom.x = c->geom.x + c->mon->m.width -(c->geom.x -c->mon->m.x);
|
||||
} else {
|
||||
c->animainit_geom.x = c->geom.x - m->m.width;
|
||||
c->animainit_geom.x = m->m.x - c->geom.width;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2364,38 +2364,17 @@ 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;
|
||||
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
|
||||
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;
|
||||
|
|
@ -2405,10 +2384,31 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
|
|||
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) : "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue