fixed getclient brokeness
This commit is contained in:
		
							parent
							
								
									cdb8e27453
								
							
						
					
					
						commit
						891831fe62
					
				
							
								
								
									
										11
									
								
								dwm.c
								
								
								
								
							
							
						
						
									
										11
									
								
								dwm.c
								
								
								
								
							| 
						 | 
					@ -829,12 +829,14 @@ focusstack(const Arg *arg) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Client *
 | 
					Client *
 | 
				
			||||||
getclient(Window w) {
 | 
					getclient(Window w) {
 | 
				
			||||||
	Client *c = NULL;
 | 
						Client *c;
 | 
				
			||||||
	Monitor *m;
 | 
						Monitor *m;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(m = mons; m; m = m->next)
 | 
						for(m = mons; m; m = m->next)
 | 
				
			||||||
		for(c = m->clients; c && c->win != w; c = c->next);
 | 
							for(c = m->clients; c; c = c->next)
 | 
				
			||||||
 | 
								if(c->win == w)
 | 
				
			||||||
				return c;
 | 
									return c;
 | 
				
			||||||
 | 
						return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long
 | 
					unsigned long
 | 
				
			||||||
| 
						 | 
					@ -1726,8 +1728,9 @@ updategeom(void) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* reassign left over clients of disappeared monitors */
 | 
						/* reassign left over clients of disappeared monitors */
 | 
				
			||||||
	for(tm = mons; tm; tm = tm->next) {
 | 
						for(tm = mons; tm; tm = tm->next) {
 | 
				
			||||||
		while((c = tm->clients)) {
 | 
							while(tm->clients) {
 | 
				
			||||||
			detach(c);
 | 
								c = tm->clients;
 | 
				
			||||||
 | 
								tm->clients = c->next;
 | 
				
			||||||
			detachstack(c);
 | 
								detachstack(c);
 | 
				
			||||||
			c->mon = newmons;
 | 
								c->mon = newmons;
 | 
				
			||||||
			attach(c);
 | 
								attach(c);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue