If monitors are equal, compare them by their addresses, to get the effect of a stable sort. --- gtk/channel-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index fe57684..f86e81d 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -973,8 +973,9 @@ static int monitors_cmp(const void *p1, const void *p2, gpointer user_data) const VDAgentMonConfig *m2 = p2; double d1 = sqrt(m1->x * m1->x + m1->y * m1->y); double d2 = sqrt(m2->x * m2->x + m2->y * m2->y); + int diff = d1 - d2; - return d1 - d2; + return diff == 0 ? (char*)p1 - (char*)p2 : diff; } static void monitors_align(VDAgentMonConfig *monitors, int nmonitors) -- 1.8.1.1.439.g50a6b54 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel