|
@ -11,9 +11,7 @@ |
|
|
|
|
|
|
|
|
#include "dwm.h" |
|
|
#include "dwm.h" |
|
|
|
|
|
|
|
|
static void floating(void); |
|
|
|
|
|
static void tiling(void); |
|
|
|
|
|
static void (*arrange)(void) = floating; |
|
|
|
|
|
|
|
|
static void (*arrange)(void *) = floating; |
|
|
|
|
|
|
|
|
void |
|
|
void |
|
|
max(void *aux) |
|
|
max(void *aux) |
|
@ -24,27 +22,30 @@ max(void *aux) |
|
|
stack->y = sy; |
|
|
stack->y = sy; |
|
|
stack->w = sw - 2 * stack->border; |
|
|
stack->w = sw - 2 * stack->border; |
|
|
stack->h = sh - 2 * stack->border; |
|
|
stack->h = sh - 2 * stack->border; |
|
|
|
|
|
craise(stack); |
|
|
resize(stack); |
|
|
resize(stack); |
|
|
discard_events(EnterWindowMask); |
|
|
discard_events(EnterWindowMask); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
floating(void) |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
floating(void *aux) |
|
|
{ |
|
|
{ |
|
|
Client *c; |
|
|
Client *c; |
|
|
|
|
|
|
|
|
|
|
|
arrange = floating; |
|
|
for(c = stack; c; c = c->snext) |
|
|
for(c = stack; c; c = c->snext) |
|
|
resize(c); |
|
|
resize(c); |
|
|
discard_events(EnterWindowMask); |
|
|
discard_events(EnterWindowMask); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
tiling(void) |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
tiling(void *aux) |
|
|
{ |
|
|
{ |
|
|
Client *c; |
|
|
Client *c; |
|
|
int n, cols, rows, gw, gh, i, j; |
|
|
int n, cols, rows, gw, gh, i, j; |
|
|
float rt, fd; |
|
|
float rt, fd; |
|
|
|
|
|
|
|
|
|
|
|
arrange = tiling; |
|
|
if(!clients) |
|
|
if(!clients) |
|
|
return; |
|
|
return; |
|
|
for(n = 0, c = clients; c; c = c->next, n++); |
|
|
for(n = 0, c = clients; c; c = c->next, n++); |
|
@ -75,17 +76,6 @@ tiling(void) |
|
|
discard_events(EnterWindowMask); |
|
|
discard_events(EnterWindowMask); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
toggle(void *aux) |
|
|
|
|
|
{ |
|
|
|
|
|
if(arrange == floating) |
|
|
|
|
|
arrange = tiling; |
|
|
|
|
|
else |
|
|
|
|
|
arrange = floating; |
|
|
|
|
|
arrange(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
void |
|
|
sel(void *aux) |
|
|
sel(void *aux) |
|
|
{ |
|
|
{ |
|
@ -280,7 +270,7 @@ manage(Window w, XWindowAttributes *wa) |
|
|
GrabModeAsync, GrabModeSync, None, None); |
|
|
GrabModeAsync, GrabModeSync, None, None); |
|
|
XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, |
|
|
XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, |
|
|
GrabModeAsync, GrabModeSync, None, None); |
|
|
GrabModeAsync, GrabModeSync, None, None); |
|
|
arrange(); |
|
|
|
|
|
|
|
|
arrange(NULL); |
|
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); |
|
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); |
|
|
focus(c); |
|
|
focus(c); |
|
|
} |
|
|
} |
|
@ -400,7 +390,7 @@ unmanage(Client *c) |
|
|
XFlush(dpy); |
|
|
XFlush(dpy); |
|
|
XSetErrorHandler(error_handler); |
|
|
XSetErrorHandler(error_handler); |
|
|
XUngrabServer(dpy); |
|
|
XUngrabServer(dpy); |
|
|
arrange(); |
|
|
|
|
|
|
|
|
arrange(NULL); |
|
|
if(stack) |
|
|
if(stack) |
|
|
focus(stack); |
|
|
focus(stack); |
|
|
} |
|
|
} |
|
|