diff --git a/cmd/wmii/frame.c b/cmd/wmii/frame.c index 189b98fa..ec2f96b3 100644 --- a/cmd/wmii/frame.c +++ b/cmd/wmii/frame.c @@ -647,7 +647,7 @@ constrain(Rectangle r, int inset) { inset = Dy(screen->brect); /* * FIXME: This will cause problems for windows with - * D(r) < 2 * isect + * D(r) < 2 * inset */ SET(best); @@ -658,7 +658,7 @@ constrain(Rectangle r, int inset) { isect = rect_intersection(r, insetrect(s->r, inset)); if(Dx(isect) >= 0 && Dy(isect) >= 0) return r; - if(Dx(isect) < 0 && Dy(isect) < 0) + if(Dx(isect) <= 0 && Dy(isect) <= 0) n = max(Dx(isect), Dy(isect)); else n = min(Dx(isect), Dy(isect)); @@ -669,9 +669,10 @@ constrain(Rectangle r, int inset) { } isect = insetrect(sbest->r, inset); - p.x = min(r.max.x - isect.min.x, 0); + p = ZP; + p.x -= min(r.max.x - isect.min.x, 0); p.x -= max(r.min.x - isect.max.x, 0); - p.y = min(r.max.y - isect.min.y, 0); + p.y -= min(r.max.y - isect.min.y, 0); p.y -= max(r.min.y - isect.max.y, 0); return rectaddpt(r, p); } diff --git a/cmd/wmii/root.c b/cmd/wmii/root.c index 4cdcc0db..b63bdb47 100644 --- a/cmd/wmii/root.c +++ b/cmd/wmii/root.c @@ -66,7 +66,7 @@ motion_event(Window *w, XMotionEvent *e) { Rectangle r, r2; r = rectsetorigin(Rect(0, 0, 1, 1), Pt(e->x_root, e->y_root)); - r2 = constrain(r, 1); + r2 = constrain(r, 0); if(!eqrect(r, r2)) warppointer(r2.min); } diff --git a/config.mk b/config.mk index 27eb98c1..d97963fb 100644 --- a/config.mk +++ b/config.mk @@ -10,7 +10,7 @@ PREFIX = /usr/local # Includes and libs INCPATH = .:$(ROOT)/include:$(INCLUDE):/usr/include -LIBS = -L/usr/lib -L$(ROOT)/lib +LIBS = -L$(ROOT)/lib -L/usr/lib # Flags include $(ROOT)/mk/gcc.mk