aewl
diff event.c @ 26:e8f627998d6f
simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Wed, 12 Jul 2006 15:17:22 +0200 |
parents | e238dc4844d7 |
children | 8ad86d0a6a53 |
line diff
1.1 --- a/event.c Wed Jul 12 00:53:11 2006 +0200 1.2 +++ b/event.c Wed Jul 12 15:17:22 2006 +0200 1.3 @@ -37,13 +37,11 @@ 1.4 [UnmapNotify] = unmapnotify 1.5 }; 1.6 1.7 -unsigned int 1.8 +void 1.9 discard_events(long even_mask) 1.10 { 1.11 XEvent ev; 1.12 - unsigned int n = 0; 1.13 - while(XCheckMaskEvent(dpy, even_mask, &ev)) n++; 1.14 - return n; 1.15 + while(XCheckMaskEvent(dpy, even_mask, &ev)); 1.16 } 1.17 1.18 static void 1.19 @@ -53,6 +51,7 @@ 1.20 Client *c; 1.21 1.22 if((c = getclient(ev->window))) { 1.23 + raise(c); 1.24 switch(ev->button) { 1.25 default: 1.26 break; 1.27 @@ -60,7 +59,7 @@ 1.28 mmove(c); 1.29 break; 1.30 case Button2: 1.31 - XLowerWindow(dpy, c->win); 1.32 + lower(c); 1.33 break; 1.34 case Button3: 1.35 mresize(c); 1.36 @@ -122,10 +121,8 @@ 1.37 1.38 if((c = getclient(ev->window))) 1.39 focus(c); 1.40 - else if(ev->window == root) { 1.41 + else if(ev->window == root) 1.42 sel_screen = True; 1.43 - /*draw_frames();*/ 1.44 - } 1.45 } 1.46 1.47 static void 1.48 @@ -133,10 +130,8 @@ 1.49 { 1.50 XCrossingEvent *ev = &e->xcrossing; 1.51 1.52 - if((ev->window == root) && !ev->same_screen) { 1.53 + if((ev->window == root) && !ev->same_screen) 1.54 sel_screen = True; 1.55 - /*draw_frames();*/ 1.56 - } 1.57 } 1.58 1.59 static void