diff options
Diffstat (limited to '')
| -rw-r--r-- | event.c | 32 |
1 files changed, 9 insertions, 23 deletions
| @@ -102,30 +102,16 @@ buttonpress(XEvent *e) | |||
| 102 | XButtonPressedEvent *ev = &e->xbutton; | 102 | XButtonPressedEvent *ev = &e->xbutton; |
| 103 | 103 | ||
| 104 | if(barwin == ev->window) { | 104 | if(barwin == ev->window) { |
| 105 | switch(ev->button) { | 105 | x = 0; |
| 106 | default: | 106 | for(a.i = 0; a.i < ntags; a.i++) { |
| 107 | x = 0; | 107 | x += textw(tags[a.i]); |
| 108 | for(a.i = 0; a.i < ntags; a.i++) { | 108 | if(ev->x < x) { |
| 109 | x += textw(tags[a.i]); | 109 | if(ev->button == Button3) |
| 110 | if(ev->x < x) { | 110 | toggleview(&a); |
| 111 | if(ev->button == Button3) | 111 | else |
| 112 | toggleview(&a); | 112 | view(&a); |
| 113 | else | 113 | return; |
| 114 | view(&a); | ||
| 115 | return; | ||
| 116 | } | ||
| 117 | } | 114 | } |
| 118 | if(ev->button == Button1) | ||
| 119 | viewprev(&a); | ||
| 120 | else if(ev->button == Button3) | ||
| 121 | viewnext(&a); | ||
| 122 | break; | ||
| 123 | case Button4: | ||
| 124 | viewprev(&a); | ||
| 125 | break; | ||
| 126 | case Button5: | ||
| 127 | viewnext(&a); | ||
| 128 | break; | ||
| 129 | } | 115 | } |
| 130 | } | 116 | } |
| 131 | else if((c = getclient(ev->window))) { | 117 | else if((c = getclient(ev->window))) { |
