diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-14 18:11:36 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-14 18:11:36 +0200 |
| commit | 6797ff84ae00d8039aa897d8b713ccdb771cd336 (patch) | |
| tree | 2fcbdc12321f9bc483f6ab462c03896a44536943 | |
| parent | removed a bunch of lines through swap removal (diff) | |
| download | dwm-6797ff84ae00d8039aa897d8b713ccdb771cd336.tar.gz dwm-6797ff84ae00d8039aa897d8b713ccdb771cd336.zip | |
fixed crash on zoom if only 1 client exists
Diffstat (limited to '')
| -rw-r--r-- | client.c | 12 |
1 files changed, 9 insertions, 3 deletions
| @@ -28,13 +28,15 @@ next(Client *c) | |||
| 28 | void | 28 | void |
| 29 | zoom(Arg *arg) | 29 | zoom(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) |
