aewl
diff client.c @ 46:58307ad56ec1
added xlock command (I need it regularly)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Thu, 13 Jul 2006 12:19:10 +0200 |
parents | 7943c72e34eb |
children | 466591c2f967 |
line diff
1.1 --- a/client.c Thu Jul 13 12:00:20 2006 +0200 1.2 +++ b/client.c Thu Jul 13 12:19:10 2006 +0200 1.3 @@ -11,9 +11,7 @@ 1.4 1.5 #include "dwm.h" 1.6 1.7 -static void floating(void); 1.8 -static void tiling(void); 1.9 -static void (*arrange)(void) = floating; 1.10 +static void (*arrange)(void *) = floating; 1.11 1.12 void 1.13 max(void *aux) 1.14 @@ -24,27 +22,30 @@ 1.15 stack->y = sy; 1.16 stack->w = sw - 2 * stack->border; 1.17 stack->h = sh - 2 * stack->border; 1.18 + craise(stack); 1.19 resize(stack); 1.20 discard_events(EnterWindowMask); 1.21 } 1.22 1.23 -static void 1.24 -floating(void) 1.25 +void 1.26 +floating(void *aux) 1.27 { 1.28 Client *c; 1.29 1.30 + arrange = floating; 1.31 for(c = stack; c; c = c->snext) 1.32 resize(c); 1.33 discard_events(EnterWindowMask); 1.34 } 1.35 1.36 -static void 1.37 -tiling(void) 1.38 +void 1.39 +tiling(void *aux) 1.40 { 1.41 Client *c; 1.42 int n, cols, rows, gw, gh, i, j; 1.43 float rt, fd; 1.44 1.45 + arrange = tiling; 1.46 if(!clients) 1.47 return; 1.48 for(n = 0, c = clients; c; c = c->next, n++); 1.49 @@ -76,17 +77,6 @@ 1.50 } 1.51 1.52 void 1.53 -toggle(void *aux) 1.54 -{ 1.55 - if(arrange == floating) 1.56 - arrange = tiling; 1.57 - else 1.58 - arrange = floating; 1.59 - arrange(); 1.60 -} 1.61 - 1.62 - 1.63 -void 1.64 sel(void *aux) 1.65 { 1.66 const char *arg = aux; 1.67 @@ -280,7 +270,7 @@ 1.68 GrabModeAsync, GrabModeSync, None, None); 1.69 XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, 1.70 GrabModeAsync, GrabModeSync, None, None); 1.71 - arrange(); 1.72 + arrange(NULL); 1.73 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); 1.74 focus(c); 1.75 } 1.76 @@ -400,7 +390,7 @@ 1.77 XFlush(dpy); 1.78 XSetErrorHandler(error_handler); 1.79 XUngrabServer(dpy); 1.80 - arrange(); 1.81 + arrange(NULL); 1.82 if(stack) 1.83 focus(stack); 1.84 }