summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-14 18:11:36 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-14 18:11:36 +0200
commit6797ff84ae00d8039aa897d8b713ccdb771cd336 (patch)
tree2fcbdc12321f9bc483f6ab462c03896a44536943 /client.c
parentremoved a bunch of lines through swap removal (diff)
downloaddwm-6797ff84ae00d8039aa897d8b713ccdb771cd336.tar.gz
dwm-6797ff84ae00d8039aa897d8b713ccdb771cd336.zip
fixed crash on zoom if only 1 client exists
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/client.c b/client.c
index e3e31b6..487cb0c 100644
--- a/client.c
+++ b/client.c
@@ -28,13 +28,15 @@ next(Client *c)
28void 28void
29zoom(Arg *arg) 29zoom(Arg *arg)
30{ 30{
31 Client **l; 31 Client **l, *c;
32 32
33 if(!sel) 33 if(!sel)
34 return; 34 return;
35 35
36 if(sel == next(clients)) 36 if(sel == next(clients) && sel->next) {
37 sel = next(sel->next); 37 if((c = next(sel->next)))
38 sel = c;
39 }
38 40
39 for(l = &clients; *l && *l != sel; l = &(*l)->next); 41 for(l = &clients; *l && *l != sel; l = &(*l)->next);
40 *l = sel->next; 42 *l = sel->next;
@@ -497,6 +499,10 @@ resize(Client *c, Bool inc)
497 if(c->inch) 499 if(c->inch)
498 c->h -= (c->h - c->baseh) % c->inch; 500 c->h -= (c->h - c->baseh) % c->inch;
499 } 501 }
502 if(c->x > sw) /* might happen on restart */
503 c->x = sw - c->w;
504 if(c->y > sh)
505 c->ty = c->y = sh - c->h;
500 if(c->minw && c->w < c->minw) 506 if(c->minw && c->w < c->minw)
501 c->w = c->minw; 507 c->w = c->minw;
502 if(c->minh && c->h < c->minh) 508 if(c->minh && c->h < c->minh)