resizemouse(Client *c)
{
int ocx, ocy;
+ int nw, nh;
Corner sticky;
XEvent ev;
break;
case MotionNotify:
XSync(dpy, False);
- c->w = abs(ocx - ev.xmotion.x);
- c->h = abs(ocy - ev.xmotion.y);
+ if((nw = abs(ocx - ev.xmotion.x)))
+ c->w = abs(ocx - ev.xmotion.x);
+ if((nh = abs(ocy - ev.xmotion.y)))
+ c->h = abs(ocy - ev.xmotion.y);
c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
if(ocx <= ev.xmotion.x)
XButtonPressedEvent *ev = &e->xbutton;
if(barwin == ev->window) {
- switch(ev->button) {
- default:
- x = 0;
- for(a.i = 0; a.i < ntags; a.i++) {
- x += textw(tags[a.i]);
- if(ev->x < x) {
+ x = 0;
+ for(a.i = 0; a.i < ntags; a.i++) {
+ x += textw(tags[a.i]);
+ if(ev->x < x) {
+ if(ev->button == Button3)
+ toggleview(&a);
+ else
view(&a);
- return;
- }
+ return;
}
- if(ev->button == Button1)
- viewprev(&a);
- else if(ev->button == Button3)
- viewnext(&a);
- break;
- case Button4:
- viewprev(&a);
- break;
- case Button5:
- viewnext(&a);
- break;
}
}
else if((c = getclient(ev->window))) {