On Tue, May 30, 2000 at 10:04:38PM +0100, Ben Cohen wrote:
> (FVWM version 2.2.4)
>
> I found the following post in the mailing list archives after having the
> similar problems. Firstly, a new window on an empty screen will appear at
> (2,2) not (0,0). Also, a Netscape window (say) that is the full
> screen-size will also appear at (2,2) not (0,0).
Ah, now that you rephrase that bug report I finally understand
what the problem is. This is still happening with 2.3.19.
> I have found two things which seem to cause this in placement.c; I am
> including a patch which solves the problem as far as I am concerned,
> although I imagine it's not the "most correct" solution (but I don't have
> time to look deeper into it).
>
> Please tell me whether this is a bug or if I'm doing something wrong...
It's a bug. The loops over the x and y coordinates are broken.
When the window finally found a proper position, the code adds
one pixel in x and y direction before placing it. There's another
bug in the collision detection. Windows are interpreted as
overlapping if they are directly adjacent. This causes the two
pixel gap between windows.
Here is the proper fix for 2.2.4:
----------------------------- snip -------------------------------
--- placement.c Sat Oct 2 18:42:13 1999
+++ placement.c.orig Wed May 31 02:08:57 2000
_at_@ -139,8 +139,8 @@
th=test_window->frame_height+2*test_window->bw;
tx = test_window->frame_x - stickyx;
ty = test_window->frame_y - stickyy;
- if((tx <= (test_x+width))&&((tx + tw) >= test_x)&&
- (ty <= (test_y+height))&&((ty + th)>= test_y))
+ if((tx < (test_x+width))&&((tx + tw) > test_x)&&
+ (ty < (test_y+height))&&((ty + th)> test_y))
{
loc_ok = False;
test_x = tx + tw;
_at_@ -149,9 +149,11 @@
}
test_window = test_window->next;
}
- test_x +=1;
+ if (!loc_ok)
+ test_x +=1;
}
- test_y +=1;
+ if (!loc_ok)
+ test_y +=1;
}
/* RBW - 11/02/1998 */
if(loc_ok == False)
----------------------------- snip -------------------------------
Bye
Dominik ^_^
--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue May 30 2000 - 19:52:18 BST