Comment 8 for bug 432311

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

The more I toy around with the spatial switching the more I feel like the current neighbor selection algorithm is bad.

I have one particularly problematic case - namely that the spatial navigation can be "wrong" in a tiled grid if there is a small skew in the tiles. This can happen fx. because Metacity imposes the size hint steps of Gnome terminals (forcing the terminal size to fit an integer number of characters, see bug #305627).

In such a case the eye doesn't immediately perceive the slightly skewed grid and the spatial navigation appears wrong.

I think the best fix for this is to make ww_find_neighbour() use an algorithm based on the windows' centers of gravity instead of their borders. Selecting the window with the nearest center in the desired spatial direction. This will ensure that we always select the right window in a slightly skew grid.