opt: disable animaiton for resize and move window dispatch

This commit is contained in:
DreamMaoMao 2026-01-18 22:54:01 +08:00
parent a7b06cfb04
commit f30ff727db
2 changed files with 17 additions and 5 deletions

View file

@ -383,6 +383,9 @@ int32_t movewin(const Arg *arg) {
if (!c->isfloating)
togglefloating(NULL);
int32_t animations_state_backup = animations;
animations = 0;
switch (arg->ui) {
case NUM_TYPE_MINUS:
c->geom.x -= arg->i;
@ -410,6 +413,7 @@ int32_t movewin(const Arg *arg) {
c->iscustomsize = 1;
c->float_geom = c->geom;
resize(c, c->geom, 0);
animations = animations_state_backup;
return 0;
}
@ -426,6 +430,9 @@ int32_t resizewin(const Arg *arg) {
if (!c || c->isfullscreen || c->ismaximizescreen)
return 0;
int32_t animations_state_backup = animations;
animations = 0;
if (ISTILED(c)) {
switch (arg->ui) {
case NUM_TYPE_MINUS:
@ -451,6 +458,7 @@ int32_t resizewin(const Arg *arg) {
break;
}
resize_tile_client(c, false, offsetx, offsety, 0);
animations = animations_state_backup;
return 0;
}
@ -481,6 +489,7 @@ int32_t resizewin(const Arg *arg) {
c->iscustomsize = 1;
c->float_geom = c->geom;
resize(c, c->geom, 0);
animations = animations_state_backup;
return 0;
}
@ -576,6 +585,9 @@ int32_t smartmovewin(const Arg *arg) {
nx = c->geom.x;
ny = c->geom.y;
int32_t animations_state_backup = animations;
animations = 0;
switch (arg->i) {
case UP:
tar = -99999;
@ -662,6 +674,7 @@ int32_t smartmovewin(const Arg *arg) {
.x = nx, .y = ny, .width = c->geom.width, .height = c->geom.height};
c->iscustomsize = 1;
resize(c, c->float_geom, 1);
animations = animations_state_backup;
return 0;
}
@ -677,6 +690,9 @@ int32_t smartresizewin(const Arg *arg) {
nw = c->geom.width;
nh = c->geom.height;
int32_t animations_state_backup = animations;
animations = 0;
switch (arg->i) {
case UP:
nh -= selmon->w.height / 8;
@ -732,6 +748,7 @@ int32_t smartresizewin(const Arg *arg) {
.x = c->geom.x, .y = c->geom.y, .width = nw, .height = nh};
c->iscustomsize = 1;
resize(c, c->float_geom, 1);
animations = animations_state_backup;
return 0;
}

View file

@ -519,9 +519,6 @@ void resize_tile_client(Client *grabc, bool isdrag, int32_t offsetx,
if (grabc->mon->isoverview)
return;
int32_t animations_state_backup = animations;
animations = 0;
const Layout *current_layout =
grabc->mon->pertag->ltidxs[grabc->mon->pertag->curtag];
if (current_layout->id == TILE || current_layout->id == DECK ||
@ -540,8 +537,6 @@ void resize_tile_client(Client *grabc, bool isdrag, int32_t offsetx,
} else if (current_layout->id == VERTICAL_SCROLLER) {
resize_tile_scroller(grabc, isdrag, offsetx, offsety, time, true);
}
animations = animations_state_backup;
}
void reset_size_per_mon(Monitor *m, int32_t tile_cilent_num,