mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-10 04:27:57 -05:00
feat: support centerwin in scroller window
This commit is contained in:
parent
1e8e4677dd
commit
9a2d2397c1
1 changed files with 19 additions and 7 deletions
|
|
@ -713,14 +713,26 @@ int centerwin(const Arg *arg) {
|
|||
Client *c = NULL;
|
||||
c = selmon->sel;
|
||||
|
||||
if (!c || c->isfullscreen)
|
||||
if (!c || c->isfullscreen || c->ismaximizescreen)
|
||||
return 0;
|
||||
if (!c->isfloating)
|
||||
setfloating(c, true);
|
||||
|
||||
c->float_geom = setclient_coordinate_center(c, c->geom, 0, 0);
|
||||
c->iscustomsize = 1;
|
||||
resize(c, c->float_geom, 1);
|
||||
if (c->isfloating) {
|
||||
c->float_geom = setclient_coordinate_center(c, c->geom, 0, 0);
|
||||
c->iscustomsize = 1;
|
||||
resize(c, c->float_geom, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!is_scroller_layout(selmon))
|
||||
return 0;
|
||||
|
||||
if (selmon->pertag->ltidxs[selmon->pertag->curtag]->id == SCROLLER) {
|
||||
c->geom.x = selmon->w.x + (selmon->w.width - c->geom.width) / 2;
|
||||
} else {
|
||||
c->geom.y = selmon->w.y + (selmon->w.height - c->geom.height) / 2;
|
||||
}
|
||||
|
||||
arrange(selmon, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1549,4 +1561,4 @@ int toggle_monitor(const Arg *arg) {
|
|||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue