commit c9150fb99a2f41b488c2f5d456204acf8d716528
parent a434beeb0bc8c0a48e567a82d1bd0c68a2061b57
Author: Kris Maglione <jg@suckless.org>
Date: Tue, 9 Dec 2008 19:23:34 -0500
Fix annoying Xinerama pointer constraint bug.
Diffstat:
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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