opt: more reasonable multi-tag window animations

This commit is contained in:
DreamMaoMao 2026-05-12 14:23:47 +08:00
parent 129d3da44e
commit 2b68d1b615

View file

@ -5,6 +5,16 @@ void set_tagin_animation(Monitor *m, Client *c) {
return; return;
} }
if ((c->isglobal || c->isunglobal) ||
(c->tags & (1 << (m->pertag->prevtag - 1)) &&
c->tags & (1 << (m->pertag->curtag - 1)))) {
c->animation.tagouting = false;
c->animation.tagouted = false;
c->animation.tagining = false;
c->animation.action = MOVE;
return;
}
if (m->pertag->curtag > m->pertag->prevtag) { if (m->pertag->curtag > m->pertag->prevtag) {
c->animainit_geom.x = config.tag_animation_direction == VERTICAL c->animainit_geom.x = config.tag_animation_direction == VERTICAL
@ -55,6 +65,17 @@ void set_arrange_visible(Monitor *m, Client *c, bool want_animation) {
} }
void set_tagout_animation(Monitor *m, Client *c) { void set_tagout_animation(Monitor *m, Client *c) {
if ((c->isglobal || c->isunglobal) ||
(c->tags & (1 << (m->pertag->prevtag - 1)) &&
c->tags & (1 << (m->pertag->curtag - 1)))) {
c->animation.tagouting = false;
c->animation.tagouted = false;
c->animation.tagining = false;
c->animation.action = MOVE;
return;
}
if (m->pertag->curtag > m->pertag->prevtag) { if (m->pertag->curtag > m->pertag->prevtag) {
c->pending = c->geom; c->pending = c->geom;
c->pending.x = c->pending.x =
@ -82,6 +103,7 @@ void set_tagout_animation(Monitor *m, Client *c) {
} }
void set_arrange_hidden(Monitor *m, Client *c, bool want_animation) { void set_arrange_hidden(Monitor *m, Client *c, bool want_animation) {
if ((c->tags & (1 << (m->pertag->prevtag - 1))) && if ((c->tags & (1 << (m->pertag->prevtag - 1))) &&
m->pertag->prevtag != 0 && m->pertag->curtag != 0 && m->pertag->prevtag != 0 && m->pertag->curtag != 0 &&
config.animations) { config.animations) {