Xinqi Bao's Git
projects
/
dwm.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
fe2775a
)
applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum
author
Anselm R. Garbe <
[email protected]
>
Tue, 18 Sep 2007 17:04:50 +0000
(19:04 +0200)
committer
Anselm R. Garbe <
[email protected]
>
Tue, 18 Sep 2007 17:04:50 +0000
(19:04 +0200)
dwm.1
diff
|
blob
|
history
dwm.c
diff
|
blob
|
history
diff --git
a/dwm.1
b/dwm.1
index
c72bb7b
..
a79b92b
100644
(file)
--- a/
dwm.1
+++ b/
dwm.1
@@
-75,7
+75,7
@@
Focus previous window.
Increases the master area width about 5% (tiled layout only).
.TP
.B Mod1\-m
Increases the master area width about 5% (tiled layout only).
.TP
.B Mod1\-m
-Toggles maximization of current window
(floating layout only)
.
+Toggles maximization of current window.
.TP
.B Mod1\-Shift\-[1..n]
Apply
.TP
.B Mod1\-Shift\-[1..n]
Apply
diff --git
a/dwm.c
b/dwm.c
index
726e797
..
36ca4eb
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-64,7
+64,7
@@
struct Client {
int minax, maxax, minay, maxay;
long flags;
unsigned int border, oldborder;
int minax, maxax, minay, maxay;
long flags;
unsigned int border, oldborder;
- Bool isbanned, isfixed, ismax, isfloating;
+ Bool isbanned, isfixed, ismax, isfloating
, wasfloating
;
Bool *tags;
Client *next;
Client *prev;
Bool *tags;
Client *next;
Client *prev;
@@
-1627,17
+1627,26
@@
void
togglemax(const char *arg) {
XEvent ev;
togglemax(const char *arg) {
XEvent ev;
- if(!sel ||
(!isarrange(floating) && !sel->isfloating) ||
sel->isfixed)
+ if(!sel || sel->isfixed)
return;
if((sel->ismax = !sel->ismax)) {
return;
if((sel->ismax = !sel->ismax)) {
+ if(isarrange(floating) || sel->isfloating)
+ sel->wasfloating = True;
+ else {
+ togglefloating(NULL);
+ sel->wasfloating = False;
+ }
sel->rx = sel->x;
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
}
sel->rx = sel->x;
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
}
- else
+ else
{
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
+ if (!sel->wasfloating)
+ togglefloating(NULL);
+ }
drawbar();
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
drawbar();
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}