opt: allow tag animaiton when client switch tag

This commit is contained in:
DreamMaoMao 2025-09-21 11:54:52 +08:00
parent 6d24ee3945
commit c03ba0436d
2 changed files with 12 additions and 2 deletions

View file

@ -892,6 +892,11 @@ void client_set_pending_state(Client *c) {
c->animation.duration = 0;
}
if (c->istagswitching) {
c->animation.duration = 0;
c->istagswitching = 0;
}
// 开始动画
client_commit(c);
c->dirty = true;

View file

@ -311,6 +311,7 @@ struct Client {
int isopensilent;
int istagsilent;
int iskilling;
int istagswitching;
int isnamedscratchpad;
bool is_pending_open_animation;
bool is_restoring_from_ov;
@ -3486,6 +3487,7 @@ void init_client_properties(Client *c) {
c->isfullscreen = 0;
c->need_float_size_reduce = 0;
c->iskilling = 0;
c->istagswitching = 0;
c->isglobal = 0;
c->isminied = 0;
c->isoverlay = 0;
@ -4959,17 +4961,20 @@ void startdrag(struct wl_listener *listener, void *data) {
void tag_client(const Arg *arg, Client *target_client) {
Client *fc;
if (target_client && arg->ui & TAGMASK) {
target_client->tags = arg->ui & TAGMASK;
target_client->istagswitching = 1;
wl_list_for_each(fc, &clients, link) {
if (fc && fc != target_client && target_client->tags & fc->tags &&
ISFULLSCREEN(fc) && !target_client->isfloating) {
clear_fullscreen_flag(fc);
}
}
view(&(Arg){.ui = arg->ui, .i = arg->i}, false);
view(&(Arg){.ui = arg->ui, .i = arg->i}, true);
} else {
view(arg, false);
view(arg, true);
}
focusclient(target_client, 1);