Fix a bug in the comparison function that could result in the wrong
index being assigned to a monitor. Change the logic to more directly map
to the description.
(cherry picked from commit
72d632673ba4531132fd1cd59c2d0b9966551300)
if (monitor1->x < monitor2->x)
return -1;
+ if (monitor1->x > monitor2->x)
+ return 1;
+
if (monitor1->y < monitor2->y)
return -1;
- if (monitor1->x == monitor2->x)
- if (monitor1->y == monitor2->y)
- return 0;
+ if (monitor1->y > monitor2->y)
+ return 1;
- return 1;
+ return 0;
}