aewl
diff event.c @ 80:8125f908c80c
several additions in mouse handling ;)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Sun, 16 Jul 2006 00:47:40 +0200 |
parents | aabebd6e61f3 |
children | 052fe7498930 |
line diff
1.1 --- a/event.c Sat Jul 15 18:51:44 2006 +0200 1.2 +++ b/event.c Sun Jul 16 00:47:40 2006 +0200 1.3 @@ -14,8 +14,8 @@ 1.4 /********** CUSTOMIZE **********/ 1.5 1.6 const char *term[] = { 1.7 - "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn", 1.8 - "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL 1.9 + "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", 1.10 + "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL 1.11 }; 1.12 const char *browse[] = { "firefox", NULL }; 1.13 const char *xlock[] = { "xlock", NULL }; 1.14 @@ -128,18 +128,34 @@ 1.15 Client *c; 1.16 1.17 if(barwin == ev->window) { 1.18 - x = 0; 1.19 - for(a.i = 0; a.i < TLast; a.i++) { 1.20 - x += textw(tags[a.i]); 1.21 - if(ev->x < x) { 1.22 - view(&a); 1.23 - break; 1.24 + switch(ev->button) { 1.25 + default: 1.26 + x = 0; 1.27 + for(a.i = 0; a.i < TLast; a.i++) { 1.28 + x += textw(tags[a.i]); 1.29 + if(ev->x < x) { 1.30 + view(&a); 1.31 + break; 1.32 + } 1.33 } 1.34 + break; 1.35 + case Button4: 1.36 + a.i = (tsel + 1 < TLast) ? tsel + 1 : 0; 1.37 + view(&a); 1.38 + break; 1.39 + case Button5: 1.40 + a.i = (tsel - 1 >= 0) ? tsel - 1 : TLast - 1; 1.41 + view(&a); 1.42 + break; 1.43 } 1.44 } 1.45 else if((c = getclient(ev->window))) { 1.46 - if(arrange == dotile && !c->dofloat) 1.47 + if(arrange == dotile && !c->isfloat) { 1.48 + if((ev->state & ControlMask) && (ev->button == Button1)) 1.49 + zoom(NULL); 1.50 return; 1.51 + } 1.52 + /* floating windows */ 1.53 higher(c); 1.54 switch(ev->button) { 1.55 default: 1.56 @@ -297,7 +313,7 @@ 1.57 default: break; 1.58 case XA_WM_TRANSIENT_FOR: 1.59 XGetTransientForHint(dpy, c->win, &trans); 1.60 - if(!c->dofloat && (c->dofloat = (trans != 0))) 1.61 + if(!c->isfloat && (c->isfloat = (trans != 0))) 1.62 arrange(NULL); 1.63 break; 1.64 case XA_WM_NORMAL_HINTS: