simplified buttonpress
6d22782e
1 file(s) · +12 −23
| 109 | 109 | for(a.i = 0; a.i < ntags; a.i++) { |
|
| 110 | 110 | x += textw(tags[a.i]); |
|
| 111 | 111 | if(ev->x < x) { |
|
| 112 | - | switch(ev->button) { |
|
| 113 | - | case Button1: |
|
| 112 | + | if(ev->button == Button1) { |
|
| 114 | 113 | if(ev->state & MODKEY) |
|
| 115 | 114 | tag(&a); |
|
| 116 | 115 | else |
|
| 117 | 116 | view(&a); |
|
| 118 | - | break; |
|
| 119 | - | case Button3: |
|
| 117 | + | } |
|
| 118 | + | else if(ev->button == Button3) { |
|
| 120 | 119 | if(ev->state & MODKEY) |
|
| 121 | 120 | toggletag(&a); |
|
| 122 | 121 | else |
|
| 123 | 122 | toggleview(&a); |
|
| 124 | - | break; |
|
| 125 | 123 | } |
|
| 126 | 124 | return; |
|
| 127 | 125 | } |
|
| 133 | 131 | } |
|
| 134 | 132 | else if((c = getclient(ev->window))) { |
|
| 135 | 133 | focus(c); |
|
| 136 | - | if(CLEANMASK(ev->state) != MODKEY) |
|
| 134 | + | if(c->ismax || CLEANMASK(ev->state) != MODKEY) |
|
| 137 | 135 | return; |
|
| 138 | - | switch(ev->button) { |
|
| 139 | - | default: |
|
| 140 | - | break; |
|
| 141 | - | case Button1: |
|
| 142 | - | if(!c->ismax && (arrange == dofloat || c->isfloat)) { |
|
| 143 | - | restack(c); |
|
| 144 | - | movemouse(c); |
|
| 145 | - | } |
|
| 146 | - | break; |
|
| 147 | - | case Button2: |
|
| 136 | + | if((ev->button == Button1) && ((arrange == dofloat) || c->isfloat)) { |
|
| 137 | + | restack(c); |
|
| 138 | + | movemouse(c); |
|
| 139 | + | } |
|
| 140 | + | else if(ev->button == Button2) |
|
| 148 | 141 | zoom(NULL); |
|
| 149 | - | break; |
|
| 150 | - | case Button3: |
|
| 151 | - | if(!c->ismax && (arrange == dofloat || c->isfloat)) { |
|
| 152 | - | restack(c); |
|
| 153 | - | resizemouse(c); |
|
| 154 | - | } |
|
| 155 | - | break; |
|
| 142 | + | else if(ev->button == Button3 && ((arrange == dofloat) || c->isfloat)) { |
|
| 143 | + | restack(c); |
|
| 144 | + | resizemouse(c); |
|
| 156 | 145 | } |
|
| 157 | 146 | } |
|
| 158 | 147 | } |
|