applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum 08c2d924
Anselm R. Garbe · 2007-09-18 19:04 2 file(s) · +13 −4
dwm.1 +1 −1
75 75
Increases the master area width about 5% (tiled layout only).
76 76
.TP
77 77
.B Mod1\-m
78 -
Toggles maximization of current window (floating layout only).
78 +
Toggles maximization of current window.
79 79
.TP
80 80
.B Mod1\-Shift\-[1..n]
81 81
Apply
dwm.c +12 −3
64 64
	int minax, maxax, minay, maxay;
65 65
	long flags; 
66 66
	unsigned int border, oldborder;
67 -
	Bool isbanned, isfixed, ismax, isfloating;
67 +
	Bool isbanned, isfixed, ismax, isfloating, wasfloating;
68 68
	Bool *tags;
69 69
	Client *next;
70 70
	Client *prev;
1627 1627
togglemax(const char *arg) {
1628 1628
	XEvent ev;
1629 1629
1630 -
	if(!sel || (!isarrange(floating) && !sel->isfloating) || sel->isfixed)
1630 +
	if(!sel || sel->isfixed)
1631 1631
		return;
1632 1632
	if((sel->ismax = !sel->ismax)) {
1633 +
		if(isarrange(floating) || sel->isfloating)
1634 +
			sel->wasfloating = True;
1635 +
		else {
1636 +
			togglefloating(NULL);
1637 +
			sel->wasfloating = False;
1638 +
		}
1633 1639
		sel->rx = sel->x;
1634 1640
		sel->ry = sel->y;
1635 1641
		sel->rw = sel->w;
1636 1642
		sel->rh = sel->h;
1637 1643
		resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
1638 1644
	}
1639 -
	else
1645 +
	else {
1640 1646
		resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
1647 +
		if (!sel->wasfloating)
1648 +
			togglefloating(NULL);
1649 +
	}
1641 1650
	drawbar();
1642 1651
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1643 1652
}