dirfocus heuristics are complicated and different from those other wms implement.
This is of course all right, except it has at least one strange property, eg. if one has two windows with aligned borders,
A | |
B | |
C | |
focusright A -> B
focusright B -> A
and one never gets to C.
There is a patched version of dirfocus on the net and I have written my own too, but both are based on comparison
of A*|xa-xb|+B*|ya-yb| with A large along the focus direction and 1 along the other.
I provide my own below, in case the developers like it.