diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-16 00:47:40 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-16 00:47:40 +0200 |
| commit | 901b3ed9b7e3e4c7542797301ae2442938bcea20 (patch) | |
| tree | ea20343294992690b7044a87a0364305bef55e3f /event.c | |
| parent | fixed XSync handling and finished man page (diff) | |
| download | dwm-901b3ed9b7e3e4c7542797301ae2442938bcea20.tar.gz dwm-901b3ed9b7e3e4c7542797301ae2442938bcea20.zip | |
several additions in mouse handling ;)
Diffstat (limited to 'event.c')
| -rw-r--r-- | event.c | 36 |
1 files changed, 26 insertions, 10 deletions
| @@ -14,8 +14,8 @@ | |||
| 14 | /********** CUSTOMIZE **********/ | 14 | /********** CUSTOMIZE **********/ |
| 15 | 15 | ||
| 16 | const char *term[] = { | 16 | const char *term[] = { |
| 17 | "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn", | 17 | "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", |
| 18 | "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL | 18 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL |
| 19 | }; | 19 | }; |
| 20 | const char *browse[] = { "firefox", NULL }; | 20 | const char *browse[] = { "firefox", NULL }; |
| 21 | const char *xlock[] = { "xlock", NULL }; | 21 | const char *xlock[] = { "xlock", NULL }; |
| @@ -128,18 +128,34 @@ buttonpress(XEvent *e) | |||
| 128 | Client *c; | 128 | Client *c; |
| 129 | 129 | ||
| 130 | if(barwin == ev->window) { | 130 | if(barwin == ev->window) { |
| 131 | x = 0; | 131 | switch(ev->button) { |
| 132 | for(a.i = 0; a.i < TLast; a.i++) { | 132 | default: |
| 133 | x += textw(tags[a.i]); | 133 | x = 0; |
| 134 | if(ev->x < x) { | 134 | for(a.i = 0; a.i < TLast; a.i++) { |
| 135 | view(&a); | 135 | x += textw(tags[a.i]); |
| 136 | break; | 136 | if(ev->x < x) { |
| 137 | view(&a); | ||
| 138 | break; | ||
| 139 | } | ||
| 137 | } | 140 | } |
| 141 | break; | ||
| 142 | case Button4: | ||
| 143 | a.i = (tsel + 1 < TLast) ? tsel + 1 : 0; | ||
| 144 | view(&a); | ||
| 145 | break; | ||
| 146 | case Button5: | ||
| 147 | a.i = (tsel - 1 >= 0) ? tsel - 1 : TLast - 1; | ||
| 148 | view(&a); | ||
| 149 | break; | ||
| 138 | } | 150 | } |
| 139 | } | 151 | } |
| 140 | else if((c = getclient(ev->window))) { | 152 | else if((c = getclient(ev->window))) { |
| 141 | if(arrange == dotile && !c->dofloat) | 153 | if(arrange == dotile && !c->isfloat) { |
| 154 | if((ev->state & ControlMask) && (ev->button == Button1)) | ||
| 155 | zoom(NULL); | ||
| 142 | return; | 156 | return; |
| 157 | } | ||
| 158 | /* floating windows */ | ||
| 143 | higher(c); | 159 | higher(c); |
| 144 | switch(ev->button) { | 160 | switch(ev->button) { |
| 145 | default: | 161 | default: |
| @@ -297,7 +313,7 @@ propertynotify(XEvent *e) | |||
| 297 | default: break; | 313 | default: break; |
| 298 | case XA_WM_TRANSIENT_FOR: | 314 | case XA_WM_TRANSIENT_FOR: |
| 299 | XGetTransientForHint(dpy, c->win, &trans); | 315 | XGetTransientForHint(dpy, c->win, &trans); |
| 300 | if(!c->dofloat && (c->dofloat = (trans != 0))) | 316 | if(!c->isfloat && (c->isfloat = (trans != 0))) |
| 301 | arrange(NULL); | 317 | arrange(NULL); |
| 302 | break; | 318 | break; |
| 303 | case XA_WM_NORMAL_HINTS: | 319 | case XA_WM_NORMAL_HINTS: |
