Merge pull request #932 from ernestoCruz05/carousel

feat: carousel-like behaviour when swapping tags
This commit is contained in:
DreamMaoMao 2026-05-24 11:08:02 +08:00 committed by GitHub
commit 2a83505593
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 57 additions and 19 deletions

View file

@ -15,7 +15,11 @@ void set_tagin_animation(Monitor *m, Client *c) {
return;
}
if (m->pertag->curtag > m->pertag->prevtag) {
bool going_forward = m->carousel_anim_dir
? m->carousel_anim_dir > 0
: m->pertag->curtag > m->pertag->prevtag;
if (going_forward) {
c->animainit_geom.x = config.tag_animation_direction == VERTICAL
? c->animation.current.x
@ -75,7 +79,10 @@ void set_tagout_animation(Monitor *m, Client *c) {
return;
}
if (m->pertag->curtag > m->pertag->prevtag) {
bool going_forward = m->carousel_anim_dir
? m->carousel_anim_dir > 0
: m->pertag->curtag > m->pertag->prevtag;
if (going_forward) {
c->pending = c->geom;
c->pending.x =
config.tag_animation_direction == VERTICAL