Merge remote-tracking branch 'upstream/master' into xft-port

* upstream/master:
  Account for height of monitors in sorting.
  bar -> lemonbar in .gitignore, remove config.h in .gitignore
  Rewrite *p, *(p+1) as p[0], p[1] for readability.
  Keep percent signs if not followed by {} block.
This commit is contained in:
krypt-n 2015-10-21 20:28:00 +02:00
commit 882c0bc57d
2 changed files with 11 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
config.h
lemonbar
*.o
*.swp

View File

@ -581,8 +581,8 @@ parse (char *text)
if (*p == '\0' || *p == '\n')
break;
if (*p == '%' && *(p+1) == '{' && (block_end = strchr(p+2, '}'))) {
p += 2;
if (p[0] == '%' && p[1] == '{' && (block_end = strchr(p++, '}'))) {
p++;
while (p < block_end) {
while (isspace(*p))
p++;
@ -910,10 +910,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)
}
if (r1->x > r2->x || r1->y + r1->height > r2->y)
{
return 1;
}
return 0;
}