Merge pull request #490 from Mental-Vortex/main
feat: Move window to center when in scroller layout
This commit is contained in:
@@ -713,17 +713,29 @@ int centerwin(const Arg *arg) {
|
|||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
c = selmon->sel;
|
c = selmon->sel;
|
||||||
|
|
||||||
if (!c || c->isfullscreen)
|
if (!c || c->isfullscreen || c->ismaximizescreen)
|
||||||
return 0;
|
return 0;
|
||||||
if (!c->isfloating)
|
|
||||||
setfloating(c, true);
|
|
||||||
|
|
||||||
|
if (c->isfloating) {
|
||||||
c->float_geom = setclient_coordinate_center(c, c->geom, 0, 0);
|
c->float_geom = setclient_coordinate_center(c, c->geom, 0, 0);
|
||||||
c->iscustomsize = 1;
|
c->iscustomsize = 1;
|
||||||
resize(c, c->float_geom, 1);
|
resize(c, c->float_geom, 1);
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
int spawn_shell(const Arg *arg) {
|
int spawn_shell(const Arg *arg) {
|
||||||
if (!arg->v)
|
if (!arg->v)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user