summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2009-06-24 12:48:01 +0100
committerAnselm R Garbe <garbeam@gmail.com>2009-06-24 12:48:01 +0100
commit891831fe623d4062bf6ffbd9016721cc551cf511 (patch)
treec2d319e2a4333e8bfdbcb226030b1f86973b983b /dwm.c
parentsome hotfix cleanup related to wild selmon-> destruction (diff)
downloaddwm-891831fe623d4062bf6ffbd9016721cc551cf511.tar.gz
dwm-891831fe623d4062bf6ffbd9016721cc551cf511.zip
fixed getclient brokeness
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dwm.c b/dwm.c
index 4c001fa..dd6701b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -829,12 +829,14 @@ focusstack(const Arg *arg) {
829 829
830Client * 830Client *
831getclient(Window w) { 831getclient(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
840unsigned long 842unsigned 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);