integrated yiyus clearurgent refactoring
This commit is contained in:
		
							parent
							
								
									e7572804fa
								
							
						
					
					
						commit
						fbce733532
					
				
							
								
								
									
										15
									
								
								dwm.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								dwm.c
									
									
									
									
									
								
							| @ -138,7 +138,7 @@ static void attachstack(Client *c); | |||||||
| static void buttonpress(XEvent *e); | static void buttonpress(XEvent *e); | ||||||
| static void checkotherwm(void); | static void checkotherwm(void); | ||||||
| static void cleanup(void); | static void cleanup(void); | ||||||
| static void clearurgent(void); | static void clearurgent(Client *c); | ||||||
| static void configure(Client *c); | static void configure(Client *c); | ||||||
| static void configurenotify(XEvent *e); | static void configurenotify(XEvent *e); | ||||||
| static void configurerequest(XEvent *e); | static void configurerequest(XEvent *e); | ||||||
| @ -365,21 +365,16 @@ cleanup(void) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void | void | ||||||
| clearurgent(void) { | clearurgent(Client *c) { | ||||||
| 	XWMHints *wmh; | 	XWMHints *wmh; | ||||||
| 	Client *c; |  | ||||||
| 
 | 
 | ||||||
| 	for(c = clients; c; c = c->next) |  | ||||||
| 		if(ISVISIBLE(c) && c->isurgent) { |  | ||||||
| 	c->isurgent = False; | 	c->isurgent = False; | ||||||
| 	if(!(wmh = XGetWMHints(dpy, c->win))) | 	if(!(wmh = XGetWMHints(dpy, c->win))) | ||||||
| 				continue; | 		return; | ||||||
| 
 |  | ||||||
| 	wmh->flags &= ~XUrgencyHint; | 	wmh->flags &= ~XUrgencyHint; | ||||||
| 	XSetWMHints(dpy, c->win, wmh); | 	XSetWMHints(dpy, c->win, wmh); | ||||||
| 	XFree(wmh); | 	XFree(wmh); | ||||||
| } | } | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| void | void | ||||||
| configure(Client *c) { | configure(Client *c) { | ||||||
| @ -617,6 +612,8 @@ focus(Client *c) { | |||||||
| 		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); | 		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); | ||||||
| 	} | 	} | ||||||
| 	if(c) { | 	if(c) { | ||||||
|  | 		if(c->isurgent) | ||||||
|  | 			clearurgent(c); | ||||||
| 		detachstack(c); | 		detachstack(c); | ||||||
| 		attachstack(c); | 		attachstack(c); | ||||||
| 		grabbuttons(c, True); | 		grabbuttons(c, True); | ||||||
| @ -1500,7 +1497,6 @@ toggleview(const Arg *arg) { | |||||||
| 
 | 
 | ||||||
| 	if(mask) { | 	if(mask) { | ||||||
| 		tagset[seltags] = mask; | 		tagset[seltags] = mask; | ||||||
| 		clearurgent(); |  | ||||||
| 		arrange(); | 		arrange(); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -1673,7 +1669,6 @@ view(const Arg *arg) { | |||||||
| 	seltags ^= 1; /* toggle sel tagset */ | 	seltags ^= 1; /* toggle sel tagset */ | ||||||
| 	if(arg->ui & TAGMASK) | 	if(arg->ui & TAGMASK) | ||||||
| 		tagset[seltags] = arg->ui & TAGMASK; | 		tagset[seltags] = arg->ui & TAGMASK; | ||||||
| 	clearurgent(); |  | ||||||
| 	arrange(); | 	arrange(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Anselm R Garbe
						Anselm R Garbe