Hi,
In case anyone has use for it, the attached patch against hg tip
will make togglemax() work in the tiled layout by first toggling
the window's floating status and then restoring it later.
Beware though that I am not a C programmer.
Regards,
Peter
*** dwm.h~ 2007-05-25 14:58:25.000000000 +0200
--- dwm.h 2007-05-25 15:01:53.000000000 +0200
***************
*** 53,58 ****
--- 53,59 ----
long flags;
unsigned int border, oldborder;
Bool isbanned, isfixed, ismax, isfloating;
+ Bool rtogglefloating; /* revert floating state */
Bool *tags;
Client *next;
Client *prev;
*** layout.c~ 2007-05-25 14:58:25.000000000 +0200
--- layout.c 2007-05-25 14:40:27.000000000 +0200
***************
*** 231,247 ****
togglemax(const char *arg) {
XEvent ev;
! if(!sel || (lt->arrange != floating && !sel->isfloating) ||
sel->isfixed)
return;
if((sel->ismax = !sel->ismax)) {
sel->rx = sel->x;
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
resize(sel, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX,
True);
}
! else
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
drawstatus();
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
--- 231,254 ----
togglemax(const char *arg) {
XEvent ev;
! if(!sel || sel->isfixed)
return;
if((sel->ismax = !sel->ismax)) {
+ if(lt->arrange != floating && !sel->isfloating) {
+ togglefloating(NULL);
+ sel->rtogglefloating = True;
+ }
sel->rx = sel->x;
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
resize(sel, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX,
True);
}
! else {
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
+ if (sel->rtogglefloating)
+ togglefloating(NULL);
+ }
drawstatus();
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
*** dwm.1~ 2007-05-25 15:30:03.000000000 +0200
--- dwm.1 2007-05-25 15:30:17.000000000 +0200
***************
*** 81,87 ****
Decrease master area width (tiled layout only).
.TP
.B Mod1\-m
! Toggles maximization of current window (floating layout only).
.TP
.B Mod1\-Shift\-[1..n]
Apply
--- 81,87 ----
Decrease master area width (tiled layout only).
.TP
.B Mod1\-m
! Toggles maximization of current window.
.TP
.B Mod1\-Shift\-[1..n]
Apply