about summary refs log tree commit diff stats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-08-12 13:10:21 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-08-12 13:10:21 +0200
commit0937cc78bf5d8855dcd757b18e10c7dd49e7a1ab (patch)
treee241186eeb8c327beb9374fd8a82ac4499983130 /layout.c
parentf6e41b0bc3a00a2c48a996e2da4ad84be9a719f7 (diff)
downloaddwm-0937cc78bf5d8855dcd757b18e10c7dd49e7a1ab.tar.gz
moved floating to layout.c, kept tile.c outside
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/layout.c b/layout.c
index 408a2a3..fe12e1e 100644
--- a/layout.c
+++ b/layout.c
@@ -14,6 +14,24 @@ LAYOUTS
 /* extern */
 
 void
+floating(void) {
+	Client *c;
+
+	if(lt->arrange != floating)
+		return;
+
+	for(c = clients; c; c = c->next)
+		if(isvisible(c)) {
+			unban(c);
+			resize(c, c->x, c->y, c->w, c->h, True);
+		}
+		else
+			ban(c);
+	focus(NULL);
+	restack();
+}
+
+void
 focusclient(const char *arg) {
 	Client *c;
    
@@ -115,3 +133,22 @@ togglebar(const char *arg) {
 	updatebarpos();
 	lt->arrange();
 }
+
+void
+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 * sel->border, wah - 2 * sel->border, True);
+	}
+	else
+		resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
+	drawstatus();
+	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+}