On Sat, Jan 23, 2010 at 08:23:47PM +0100, Harald Dunkel wrote:
> Hi folks,
>
> using
>
> Style * MinOverlapPlacementPenalties 1 5 1 1 0 50
> Style * MinOverlapPlacement
>
> there seems to be some blind spot on the lower left corner. For testing
> I have created >100 xterms in parallel, but no window was aligned to the
> bottom _and_ the left edge.
>
> I haven't seen this for 2.5.28, but for todays snapshot and snapshot
> 20100117 its there.
>
> Can anybody reproduce this?
Yes, I broke it (well sort of) fixing another bug related to this. Please
try the attached patch on top of CVS. I won't be commiting this yet
until I do some regression testing, which means writing test cases, as it
was enough of a pig fixing this over Christmas, without the bug I introduced
as a result.
-- Thomas Adam
--
"It was the cruelest game I've ever played and it's played inside my head."
-- "Hush The Warmth", Gorky's Zygotic Mynci.
Index: fvwm/placement.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/placement.c,v
retrieving revision 1.171
diff -u -r1.171 placement.c
--- fvwm/placement.c 30 Dec 2009 22:42:23 -0000 1.171
+++ fvwm/placement.c 24 Jan 2010 01:33:15 -0000
@@ -1047,10 +1047,26 @@
*/
if (ret->best_p.y + arg->place_g.height >= arg->page_p2.y)
{
- ret->best_p.y =
- (arg->page_p2.y -
+ /* Initial placement. */
+ int f_placement = (arg->page_p2.y -
arg->place_g.height -
b.total_size.height);
+
+ /* Offset from the base, assuming we
+ * were going to be placed off-screen
+ * at this point.
+ */
+ int ff_placement = b.total_size.height -
+ (arg->place_g.height -
+ (ret->best_p.y - arg->place_g.height)
+ - b.total_size.height);
+
+
+ /* And if we were off screen, adjust
+ * our position accordingly.
+ */
+ if (ff_placement > 0)
+ ret->best_p.y = f_placement + ff_placement;
}
/* stop looking; the penalty is too high */