X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=f0e88d07129bfacaa5246166af2c9d64af06a7d8;hb=dc1690ce0fac57ef4c8cd3f0e833cfa07411830f;hp=42a6fc04908da6385f16cd7f34a4768f744ad278;hpb=d7734f996ff2eae29fea14af76711d7f51648c10;p=dwm.git diff --git a/event.c b/event.c index 42a6fc0..f0e88d0 100644 --- a/event.c +++ b/event.c @@ -48,6 +48,14 @@ movemouse(Client *c) { XSync(dpy, False); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); + if(abs(c->x) < sx + SNAP) + c->x = sx; + if(abs(c->y) < sy + bh + SNAP) + c->y = sy + bh; + if(c->x + c->w > sx + sw - SNAP) + c->x = sw - c->w - 2 * BORDERPX; + if(c->y + c->h > sy + sh - SNAP) + c->y = sh - c->h - 2 * BORDERPX; resize(c, False, TopLeft); break; } @@ -136,7 +144,8 @@ buttonpress(XEvent *e) { } else if(ev->button == Button2) zoom(NULL); - else if(ev->button == Button3 && (arrange == dofloat || c->isfloat)) { + else if(ev->button == Button3 && (arrange == dofloat || c->isfloat) && + !c->isfixed) { restack(); resizemouse(c); }