--- fvwm/placement.c.orig	2005-07-05 08:55:43.000000000 +0200
+++ fvwm/placement.c	2005-07-05 09:26:50.000000000 +0200
@@ -397,7 +397,9 @@
 		(Scr.Desktops->ewmh_working_area.x +
 		 Scr.Desktops->ewmh_working_area.width) - t->frame_g.width;
 	if (xtest > x)
+	{
 		xnew = MIN(xnew, xtest);
+	}
 	/* Test the values of the right edges of every window */
 	for (testw = Scr.FvwmRoot.next ; testw != NULL ; testw = testw->next)
 	{
@@ -448,12 +450,16 @@
 				}
 			}
 		}
-		else if (y < testw->frame_g.height + testw->frame_g.y -
-			 stickyy && testw->frame_g.y - stickyy <
-			 t->frame_g.height + y)
+		else if (
+			y <
+			testw->frame_g.height + testw->frame_g.y - stickyy &&
+			testw->frame_g.y - stickyy < t->frame_g.height + y &&
+			PageLeft <
+			testw->frame_g.width + testw->frame_g.x - stickyx &&
+			testw->frame_g.x - stickyx < PageRight)
 		{
-			win_left = PageLeft + testw->frame_g.x - stickyx -
-				t->frame_g.width;
+			win_left = PageLeft + pdeltax + testw->frame_g.x -
+				stickyx - t->frame_g.width;
 			for(i=start; i <= GET_NEXT_STEP; i++)
 			{
 				xtest = (win_left) + (testw->frame_g.width) *
@@ -463,7 +469,8 @@
 					xnew = MIN(xnew, xtest);
 				}
 			}
-			win_left = PageLeft + testw->frame_g.x - stickyx;
+			win_left = PageLeft + pdeltax + testw->frame_g.x -
+				stickyx;
 			for(i=start; i <= GET_NEXT_STEP; i++)
 			{
 				xtest = (win_left) + (testw->frame_g.width) *
--- ChangeLog.orig	2005-07-05 09:27:03.000000000 +0200
+++ ChangeLog	2005-07-05 09:27:46.000000000 +0200
@@ -1,3 +1,9 @@
+2005-07-05  Dominik Vogt  <dominik.vogt@gmx.de>
+
+	* fvwm/placement.c (get_next_x):
+	fixed collision detection of windows on pages other than the current
+	one during placement
+
 2005-02-28  Dominik Vogt  <dominik.vogt@gmx.de>
 
 	* fvwm/icons.c (DrawIconPixmapWindow):
