From f583aca2076d917dc8ccb8db47b53c72a58210ff Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Sun, 17 May 2009 21:35:01 +0000 Subject: [PATCH] fix xinerama monitor sorting. xinerama monitor sorting should consider position and not just size. Patch by manio, modified to handle y axis as well. SVN revision: 40712 --- src/bin/e_xinerama.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/e_xinerama.c b/src/bin/e_xinerama.c index b16fea573..67fe3611a 100644 --- a/src/bin/e_xinerama.c +++ b/src/bin/e_xinerama.c @@ -211,7 +211,14 @@ _e_xinerama_cb_screen_sort(const void *data1, const void *data2) scr = data1; scr2 = data2; - dif = (scr2->w * scr2->h) - (scr->w * scr->h); - if (dif == 0) return scr->screen - scr2->screen; + if (scr2->x != scr->x) + return scr2->x - scr->x; + else if (scr2->y != scr->y) + return scr2->y - scr->y; + else + { + dif = (scr2->w * scr2->h) - (scr->w * scr->h); + if (dif == 0) return scr->screen - scr2->screen; + } return dif; }