[fusion-commits] Put windows plugin: Changes to 'master' (b9d7c2ef8753c8abb36d66a6ab2eff70a04fdf5b)

cornelius at server.beryl-project.org cornelius at server.beryl-project.org
Tue Jul 3 02:21:35 CEST 2007


New commits:
commit b9d7c2ef8753c8abb36d66a6ab2eff70a04fdf5b
Author: Erkin Bahceci <erkinbah at gmail.com>
Date:   Mon Jul 2 20:18:46 2007 -0400

    Fix the 1 pixel jump just before reaching target.

commit 4e3370f90a46a61d19449c6ad03538af16216105
Author: Pierpaolo Follia <pfollia at gmail.com>
Date:   Mon Jul 2 20:18:30 2007 -0400

    Make put respect target position.


 put.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)


Modified: fusion/plugins/put/put.c
===================================================================
--- fusion/plugins/put/put.c
+++ fusion/plugins/put/put.c
@@ -134,6 +134,9 @@ static int adjustPutVelocity(CompWindow * w)
 
 		pw->dx = pw->dy = 0;
 
+		dx = (pw->lastX + pw->tx) - pw->x;
+		dy = (pw->lastY + pw->ty) - pw->y;
+		moveWindow(w, dx, dy, TRUE, TRUE);
 		/* sync position with X server */
 		syncWindowPosition(w);
 		return 0;
@@ -169,20 +172,26 @@ static void putPreparePaintScreen(CompScreen * s, int msSinceLastPaint)
 
 				if (pw->adjust)
 				{
-					pw->adjust = adjustPutVelocity(w);
-					ps->moreAdjust |= pw->adjust;
-
 					pw->tx += pw->xVelocity * chunk;
 					pw->ty += pw->yVelocity * chunk;
 
-					dx = (pw->lastX + pw->tx) - pw->x;
-					dy = (pw->lastY + pw->ty) - pw->y;
+					int adjx =
+						(pw->xVelocity > 0 ? 1 :
+						 pw->xVelocity < 0 ? -1 : 0);
+					int adjy =
+						(pw->yVelocity > 0 ? 1 :
+						 pw->yVelocity < 0 ? -1 : 0);
+
+					dx = (pw->lastX + pw->tx + adjx) - pw->x;
+					dy = (pw->lastY + pw->ty + adjy) - pw->y;
 
 					moveWindow(w, dx, dy, TRUE, TRUE);
 
 					pw->x += dx;
 					pw->y += dy;
 
+					pw->adjust = adjustPutVelocity(w);
+					ps->moreAdjust |= pw->adjust;
 				}
 			}
 			if (!ps->moreAdjust)


More information about the commits mailing list