Skip to content

Commit

Permalink
Account for height of monitors in sorting.
Browse files Browse the repository at this point in the history
  • Loading branch information
neeasade committed Oct 21, 2015
1 parent 177deb0 commit a5597f7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lemonbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ parse (char *text)
break;

case 'T':
if (*p == '-') { //Reset to automatic font selection
if (*p == '-') { //Reset to automatic font selection
font_index = -1;
p++;
break;
Expand Down Expand Up @@ -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 *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;
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;
}
Expand Down

0 comments on commit a5597f7

Please sign in to comment.