Merge pull request #150 from neeasade/monitor_sort
Fix monitor sorting with mix of portrait and landscape layout.
This commit is contained in:
commit
1585d7257d
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
config.h
|
lemonbar
|
||||||
bar
|
|
||||||
*.o
|
*.o
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
|
13
lemonbar.c
13
lemonbar.c
|
@ -541,7 +541,7 @@ parse (char *text)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
if (*p == '-') { //Reset to automatic font selection
|
if (*p == '-') { //Reset to automatic font selection
|
||||||
font_index = -1;
|
font_index = -1;
|
||||||
p++;
|
p++;
|
||||||
break;
|
break;
|
||||||
|
@ -784,10 +784,15 @@ rect_sort_cb (const void *p1, const void *p2)
|
||||||
const xcb_rectangle_t *r1 = (xcb_rectangle_t *)p1;
|
const xcb_rectangle_t *r1 = (xcb_rectangle_t *)p1;
|
||||||
const xcb_rectangle_t *r2 = (xcb_rectangle_t *)p2;
|
const xcb_rectangle_t *r2 = (xcb_rectangle_t *)p2;
|
||||||
|
|
||||||
if (r1->x < r2->x || r1->y < r2->y)
|
if (r1->x < r2->x || r1->y + r1->height <= r2->y)
|
||||||
|
{
|
||||||
return -1;
|
return -1;
|
||||||
if (r1->x > r2->x || r1->y > r2->y)
|
}
|
||||||
return 1;
|
|
||||||
|
if (r1->x > r2->x || r1->y + r1->height > r2->y)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user