diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 13 |
1 files changed, 8 insertions, 5 deletions
| @@ -829,12 +829,14 @@ focusstack(const Arg *arg) { | |||
| 829 | 829 | ||
| 830 | Client * | 830 | Client * |
| 831 | getclient(Window w) { | 831 | getclient(Window w) { |
| 832 | Client *c = NULL; | 832 | Client *c; |
| 833 | Monitor *m; | 833 | Monitor *m; |
| 834 | 834 | ||
| 835 | for(m = mons; m; m = m->next) | 835 | for(m = mons; m; m = m->next) |
| 836 | for(c = m->clients; c && c->win != w; c = c->next); | 836 | for(c = m->clients; c; c = c->next) |
| 837 | return c; | 837 | if(c->win == w) |
| 838 | return c; | ||
| 839 | return NULL; | ||
| 838 | } | 840 | } |
| 839 | 841 | ||
| 840 | unsigned long | 842 | unsigned long |
| @@ -1726,8 +1728,9 @@ updategeom(void) { | |||
| 1726 | 1728 | ||
| 1727 | /* reassign left over clients of disappeared monitors */ | 1729 | /* reassign left over clients of disappeared monitors */ |
| 1728 | for(tm = mons; tm; tm = tm->next) { | 1730 | for(tm = mons; tm; tm = tm->next) { |
| 1729 | while((c = tm->clients)) { | 1731 | while(tm->clients) { |
| 1730 | detach(c); | 1732 | c = tm->clients; |
| 1733 | tm->clients = c->next; | ||
| 1731 | detachstack(c); | 1734 | detachstack(c); |
| 1732 | c->mon = newmons; | 1735 | c->mon = newmons; |
| 1733 | attach(c); | 1736 | attach(c); |
