diff options
author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-13 12:19:10 +0200 |
---|---|---|
committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-13 12:19:10 +0200 |
commit | ce846e941bee651ae5f17845f670f016040902f9 (patch) | |
tree | 9463488fb1911e7c368a4300f53622a1d9d0fecc /client.c | |
parent | 0a638a4cafb3dd754a596605bb55ac7977fba71e (diff) |
added xlock command (I need it regularly)
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 30 |
1 files changed, 10 insertions, 20 deletions
@@ -11,9 +11,7 @@ #include "dwm.h" -static void floating(void); -static void tiling(void); -static void (*arrange)(void) = floating; +static void (*arrange)(void *) = floating; void max(void *aux) @@ -24,27 +22,30 @@ max(void *aux) stack->y = sy; stack->w = sw - 2 * stack->border; stack->h = sh - 2 * stack->border; + craise(stack); resize(stack); discard_events(EnterWindowMask); } -static void -floating(void) +void +floating(void *aux) { Client *c; + arrange = floating; for(c = stack; c; c = c->snext) resize(c); discard_events(EnterWindowMask); } -static void -tiling(void) +void +tiling(void *aux) { Client *c; int n, cols, rows, gw, gh, i, j; float rt, fd; + arrange = tiling; if(!clients) return; for(n = 0, c = clients; c; c = c->next, n++); @@ -76,17 +77,6 @@ tiling(void) } void -toggle(void *aux) -{ - if(arrange == floating) - arrange = tiling; - else - arrange = floating; - arrange(); -} - - -void sel(void *aux) { const char *arg = aux; @@ -280,7 +270,7 @@ manage(Window w, XWindowAttributes *wa) GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); - arrange(); + arrange(NULL); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); focus(c); } @@ -400,7 +390,7 @@ unmanage(Client *c) XFlush(dpy); XSetErrorHandler(error_handler); XUngrabServer(dpy); - arrange(); + arrange(NULL); if(stack) focus(stack); } |