Maximus: Simplify the +/- border width madness
commit939f46b87003efbb54ac23a90e2420321b4ebc08
authorCarlos R. Mafra <crmafra@gmail.com>
Mon, 15 Mar 2010 17:27:23 +0000 (15 18:27 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 15 Mar 2010 18:49:32 +0000 (15 19:49 +0100)
treec129d5f3866638366dc854b72de753e1cae0b54e
parentee569220df3fd89a52f9e97cc258123aa8312d58
Maximus: Simplify the +/- border width madness

Taking the border width into account was making it hard to follow the
algorithm, and complicating things usually lead to mistakes.

In fact, in trying to account for this +/- 1 pixel issue the maximus
geometry for the requested window would sometimes overlap another window
by one or two pixels (depending if it was on the right or left). Therefore,
applying the maximus geometry to this other window in sequence would
maximize it completely instead of finding the correct tiled geometry.

So that always bugged me. Now I got tired of it and decided to kill the
whole consideration of the border width, and simply put some "+ 1"
inconditionally to be on the safe side.

Now it can happen that the windows will stay away one or two pixels,
but trying to be 'good enough' is better than trying to be 'perfect'
and getting it wrong for corner cases.

And the matter is worse because the size of xterms are 'quantized', so
changing the position of the other windows by a few pixels result sometimes
in a overlap of +1 pixel, or a distance of 1 or 2 pixels. Furthermore,
the bottom of xcalc behaves differently from the bottom of a xterm or
xjed (for xcalc the ad hoc correction for bottom_0 must be -8 in total).

But now my tests show that things are OK, and I can use maximus
for all the windows in the screen and no overlap will occur (except
if one of the windows is a xcalc, I don't know why).
src/actions.c