2019-10-04 20:46:47 +00:00
|
|
|
void
|
2019-11-04 07:17:00 +00:00
|
|
|
maximize(int x, int y, int w, int h)
|
|
|
|
{
|
2019-10-04 20:46:47 +00:00
|
|
|
XEvent ev;
|
|
|
|
|
2019-11-04 07:17:00 +00:00
|
|
|
if (!selmon->sel || selmon->sel->isfixed)
|
2019-10-04 20:46:47 +00:00
|
|
|
return;
|
|
|
|
XRaiseWindow(dpy, selmon->sel->win);
|
2019-11-04 07:17:00 +00:00
|
|
|
if (!selmon->sel->ismax) {
|
|
|
|
if (!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)
|
2019-10-04 20:46:47 +00:00
|
|
|
selmon->sel->wasfloating = True;
|
|
|
|
else {
|
|
|
|
togglefloating(NULL);
|
|
|
|
selmon->sel->wasfloating = False;
|
|
|
|
}
|
|
|
|
selmon->sel->oldx = selmon->sel->x;
|
|
|
|
selmon->sel->oldy = selmon->sel->y;
|
|
|
|
selmon->sel->oldw = selmon->sel->w;
|
|
|
|
selmon->sel->oldh = selmon->sel->h;
|
|
|
|
resize(selmon->sel, x, y, w, h, True);
|
|
|
|
selmon->sel->ismax = True;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True);
|
2019-11-04 07:17:00 +00:00
|
|
|
if (!selmon->sel->wasfloating)
|
2019-10-04 20:46:47 +00:00
|
|
|
togglefloating(NULL);
|
|
|
|
selmon->sel->ismax = False;
|
|
|
|
}
|
|
|
|
drawbar(selmon);
|
2019-11-04 07:17:00 +00:00
|
|
|
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
2019-10-04 20:46:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2019-11-04 07:17:00 +00:00
|
|
|
togglemax(const Arg *arg)
|
|
|
|
{
|
2019-10-04 20:46:47 +00:00
|
|
|
maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2019-11-04 07:17:00 +00:00
|
|
|
toggleverticalmax(const Arg *arg)
|
|
|
|
{
|
2019-10-04 20:46:47 +00:00
|
|
|
maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2019-11-04 07:17:00 +00:00
|
|
|
togglehorizontalmax(const Arg *arg)
|
|
|
|
{
|
2019-10-04 20:46:47 +00:00
|
|
|
maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h);
|
|
|
|
}
|