summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 07:59:13 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 07:59:13 +0100
commit352cae4380713949d3800ebcda7aff3bb5ab9efc (patch)
treedd301143a6777dacb09b90d6d27d16aeb19056fc /client.c
parentjust ignore the FD_ISSET check in main.c of xfd, just call XPending (which do... (diff)
downloaddwm-352cae4380713949d3800ebcda7aff3bb5ab9efc.tar.gz
dwm-352cae4380713949d3800ebcda7aff3bb5ab9efc.zip
several changes, made togglemax extern and separated it from zoom() - moved zoom() and togglemax() into layout.c, changed void (*func)(Arg *) into void (*func)(Arg), changed default keybindings of focusnext/focusprev and incmasterw to h/j/k/l accordingly, made keys in config*h appear alphabetically (special keys first), renamed resizemaster into incmasterw, renamed MASTER into MASTERWIDTH
Diffstat (limited to 'client.c')
-rw-r--r--client.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/client.c b/client.c
index c962c39..3d9cd40 100644
--- a/client.c
+++ b/client.c
@@ -83,24 +83,6 @@ setclientstate(Client *c, long state) {
83 PropModeReplace, (unsigned char *)data, 2); 83 PropModeReplace, (unsigned char *)data, 2);
84} 84}
85 85
86static void
87togglemax(Client *c) {
88 XEvent ev;
89
90 if(c->isfixed)
91 return;
92 if((c->ismax = !c->ismax)) {
93 c->rx = c->x;
94 c->ry = c->y;
95 c->rw = c->w;
96 c->rh = c->h;
97 resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
98 }
99 else
100 resize(c, c->rx, c->ry, c->rw, c->rh, True);
101 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
102}
103
104static int 86static int
105xerrordummy(Display *dsply, XErrorEvent *ee) { 87xerrordummy(Display *dsply, XErrorEvent *ee) {
106 return 0; 88 return 0;
@@ -171,7 +153,7 @@ focus(Client *c) {
171} 153}
172 154
173void 155void
174killclient(Arg *arg) { 156killclient(Arg arg) {
175 if(!sel) 157 if(!sel)
176 return; 158 return;
177 if(isprotodel(sel)) 159 if(isprotodel(sel))
@@ -303,7 +285,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
303} 285}
304 286
305void 287void
306toggleversatile(Arg *arg) { 288toggleversatile(Arg arg) {
307 if(!sel || lt->arrange == versatile) 289 if(!sel || lt->arrange == versatile)
308 return; 290 return;
309 sel->isversatile = !sel->isversatile; 291 sel->isversatile = !sel->isversatile;
@@ -402,25 +384,3 @@ unmanage(Client *c) {
402 XUngrabServer(dpy); 384 XUngrabServer(dpy);
403 lt->arrange(); 385 lt->arrange();
404} 386}
405
406void
407zoom(Arg *arg) {
408 unsigned int n;
409 Client *c;
410
411 if(!sel)
412 return;
413 if(sel->isversatile || (lt->arrange == versatile)) {
414 togglemax(sel);
415 return;
416 }
417 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
418 n++;
419 if((c = sel) == nexttiled(clients))
420 if(!(c = nexttiled(c->next)))
421 return;
422 detach(c);
423 attach(c);
424 focus(c);
425 lt->arrange();
426}