Mercurial > dwm-meillo
comparison event.c @ 399:74739798b0b2
simplified buttonpress
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Fri, 01 Sep 2006 15:31:59 +0200 |
parents | 9c703e528e58 |
children | 052657ff2e7b |
comparison
equal
deleted
inserted
replaced
398:9c703e528e58 | 399:74739798b0b2 |
---|---|
107 if(barwin == ev->window) { | 107 if(barwin == ev->window) { |
108 x = 0; | 108 x = 0; |
109 for(a.i = 0; a.i < ntags; a.i++) { | 109 for(a.i = 0; a.i < ntags; a.i++) { |
110 x += textw(tags[a.i]); | 110 x += textw(tags[a.i]); |
111 if(ev->x < x) { | 111 if(ev->x < x) { |
112 switch(ev->button) { | 112 if(ev->button == Button1) { |
113 case Button1: | |
114 if(ev->state & MODKEY) | 113 if(ev->state & MODKEY) |
115 tag(&a); | 114 tag(&a); |
116 else | 115 else |
117 view(&a); | 116 view(&a); |
118 break; | 117 } |
119 case Button3: | 118 else if(ev->button == Button3) { |
120 if(ev->state & MODKEY) | 119 if(ev->state & MODKEY) |
121 toggletag(&a); | 120 toggletag(&a); |
122 else | 121 else |
123 toggleview(&a); | 122 toggleview(&a); |
124 break; | |
125 } | 123 } |
126 return; | 124 return; |
127 } | 125 } |
128 } | 126 } |
129 if(ev->x < x + bmw) { | 127 if(ev->x < x + bmw) { |
131 togglemode(NULL); | 129 togglemode(NULL); |
132 } | 130 } |
133 } | 131 } |
134 else if((c = getclient(ev->window))) { | 132 else if((c = getclient(ev->window))) { |
135 focus(c); | 133 focus(c); |
136 if(CLEANMASK(ev->state) != MODKEY) | 134 if(c->ismax || CLEANMASK(ev->state) != MODKEY) |
137 return; | 135 return; |
138 switch(ev->button) { | 136 if((ev->button == Button1) && ((arrange == dofloat) || c->isfloat)) { |
139 default: | 137 restack(c); |
140 break; | 138 movemouse(c); |
141 case Button1: | 139 } |
142 if(!c->ismax && (arrange == dofloat || c->isfloat)) { | 140 else if(ev->button == Button2) |
143 restack(c); | |
144 movemouse(c); | |
145 } | |
146 break; | |
147 case Button2: | |
148 zoom(NULL); | 141 zoom(NULL); |
149 break; | 142 else if(ev->button == Button3 && ((arrange == dofloat) || c->isfloat)) { |
150 case Button3: | 143 restack(c); |
151 if(!c->ismax && (arrange == dofloat || c->isfloat)) { | 144 resizemouse(c); |
152 restack(c); | |
153 resizemouse(c); | |
154 } | |
155 break; | |
156 } | 145 } |
157 } | 146 } |
158 } | 147 } |
159 | 148 |
160 static void | 149 static void |