mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-05 07:15:49 -04:00
opt: disable animaiton for resize and move window dispatch
This commit is contained in:
parent
a7b06cfb04
commit
f30ff727db
2 changed files with 17 additions and 5 deletions
|
|
@ -383,6 +383,9 @@ int32_t movewin(const Arg *arg) {
|
||||||
if (!c->isfloating)
|
if (!c->isfloating)
|
||||||
togglefloating(NULL);
|
togglefloating(NULL);
|
||||||
|
|
||||||
|
int32_t animations_state_backup = animations;
|
||||||
|
animations = 0;
|
||||||
|
|
||||||
switch (arg->ui) {
|
switch (arg->ui) {
|
||||||
case NUM_TYPE_MINUS:
|
case NUM_TYPE_MINUS:
|
||||||
c->geom.x -= arg->i;
|
c->geom.x -= arg->i;
|
||||||
|
|
@ -410,6 +413,7 @@ int32_t movewin(const Arg *arg) {
|
||||||
c->iscustomsize = 1;
|
c->iscustomsize = 1;
|
||||||
c->float_geom = c->geom;
|
c->float_geom = c->geom;
|
||||||
resize(c, c->geom, 0);
|
resize(c, c->geom, 0);
|
||||||
|
animations = animations_state_backup;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -426,6 +430,9 @@ int32_t resizewin(const Arg *arg) {
|
||||||
if (!c || c->isfullscreen || c->ismaximizescreen)
|
if (!c || c->isfullscreen || c->ismaximizescreen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
int32_t animations_state_backup = animations;
|
||||||
|
animations = 0;
|
||||||
|
|
||||||
if (ISTILED(c)) {
|
if (ISTILED(c)) {
|
||||||
switch (arg->ui) {
|
switch (arg->ui) {
|
||||||
case NUM_TYPE_MINUS:
|
case NUM_TYPE_MINUS:
|
||||||
|
|
@ -451,6 +458,7 @@ int32_t resizewin(const Arg *arg) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resize_tile_client(c, false, offsetx, offsety, 0);
|
resize_tile_client(c, false, offsetx, offsety, 0);
|
||||||
|
animations = animations_state_backup;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -481,6 +489,7 @@ int32_t resizewin(const Arg *arg) {
|
||||||
c->iscustomsize = 1;
|
c->iscustomsize = 1;
|
||||||
c->float_geom = c->geom;
|
c->float_geom = c->geom;
|
||||||
resize(c, c->geom, 0);
|
resize(c, c->geom, 0);
|
||||||
|
animations = animations_state_backup;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -576,6 +585,9 @@ int32_t smartmovewin(const Arg *arg) {
|
||||||
nx = c->geom.x;
|
nx = c->geom.x;
|
||||||
ny = c->geom.y;
|
ny = c->geom.y;
|
||||||
|
|
||||||
|
int32_t animations_state_backup = animations;
|
||||||
|
animations = 0;
|
||||||
|
|
||||||
switch (arg->i) {
|
switch (arg->i) {
|
||||||
case UP:
|
case UP:
|
||||||
tar = -99999;
|
tar = -99999;
|
||||||
|
|
@ -662,6 +674,7 @@ int32_t smartmovewin(const Arg *arg) {
|
||||||
.x = nx, .y = ny, .width = c->geom.width, .height = c->geom.height};
|
.x = nx, .y = ny, .width = c->geom.width, .height = c->geom.height};
|
||||||
c->iscustomsize = 1;
|
c->iscustomsize = 1;
|
||||||
resize(c, c->float_geom, 1);
|
resize(c, c->float_geom, 1);
|
||||||
|
animations = animations_state_backup;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -677,6 +690,9 @@ int32_t smartresizewin(const Arg *arg) {
|
||||||
nw = c->geom.width;
|
nw = c->geom.width;
|
||||||
nh = c->geom.height;
|
nh = c->geom.height;
|
||||||
|
|
||||||
|
int32_t animations_state_backup = animations;
|
||||||
|
animations = 0;
|
||||||
|
|
||||||
switch (arg->i) {
|
switch (arg->i) {
|
||||||
case UP:
|
case UP:
|
||||||
nh -= selmon->w.height / 8;
|
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};
|
.x = c->geom.x, .y = c->geom.y, .width = nw, .height = nh};
|
||||||
c->iscustomsize = 1;
|
c->iscustomsize = 1;
|
||||||
resize(c, c->float_geom, 1);
|
resize(c, c->float_geom, 1);
|
||||||
|
animations = animations_state_backup;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -519,9 +519,6 @@ void resize_tile_client(Client *grabc, bool isdrag, int32_t offsetx,
|
||||||
if (grabc->mon->isoverview)
|
if (grabc->mon->isoverview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int32_t animations_state_backup = animations;
|
|
||||||
animations = 0;
|
|
||||||
|
|
||||||
const Layout *current_layout =
|
const Layout *current_layout =
|
||||||
grabc->mon->pertag->ltidxs[grabc->mon->pertag->curtag];
|
grabc->mon->pertag->ltidxs[grabc->mon->pertag->curtag];
|
||||||
if (current_layout->id == TILE || current_layout->id == DECK ||
|
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) {
|
} else if (current_layout->id == VERTICAL_SCROLLER) {
|
||||||
resize_tile_scroller(grabc, isdrag, offsetx, offsety, time, true);
|
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,
|
void reset_size_per_mon(Monitor *m, int32_t tile_cilent_num,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue