fix for a sigularity where there is no candidate left.

Could you pull this please?
Now with exact window positioning there is a singularity where a window is neither on the side nor below or above. This adds a threshold to the window selection.