Make get_output_next() work with non-aligned RandR setups (+test) (Thanks Feh, swh, Moritz)

A good visualization of the new algorithm is this:

           +--------+
           |        |
+--------+=|   S1   |========================
|        | |        |
|   S0   | +--------+
|        |         +--------+
+--------+=========|        |================
                   |   S2   | +--------+
                   |        | |        |
                   +--------+ |   S3   |
                              |        |
                              +--------+

When focus is on S0, 'focus output right' will first match S1 (the
closest output which overlaps in the highlighted area), then S2, but not
S3 (since S3 does not overlap into the highlighted area).

fixes #669
fixes #771
This commit is contained in:
Michael Stapelberg
2012-09-22 16:49:37 +02:00
parent 89ca48be20
commit 19883108a9
5 changed files with 242 additions and 76 deletions

View File

@ -486,7 +486,7 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap)
else
return false;
next_output = get_output_next(direction, current_output);
next_output = get_output_next(direction, current_output, CLOSEST_OUTPUT);
if (!next_output)
return false;
DLOG("Next output is %s\n", next_output->name);