Put geometry checks after width/height adjust

This commit is contained in:
John Vogel 2014-05-31 21:56:50 -04:00
parent caf14a0ec4
commit e81c1ff8cb
1 changed files with 6 additions and 7 deletions

13
bar.c
View File

@ -578,19 +578,18 @@ monitor_create_chain (xcb_rectangle_t *rects, const int num)
height = h;
}
/* Check the geometry */
if (bx + bw > width || by + bh > height) {
fprintf(stderr, "The geometry specified doesn't fit the screen!\n");
exit(EXIT_FAILURE);
}
if (bw < 0)
bw = width - bx;
if (bh < 0 || bh > height)
bh = main_font->height + bu + 2;
/* Check the geometry */
if (bx + bw > width || by + bh > height) {
fprintf(stderr, "The geometry specified doesn't fit the screen!\n");
exit(EXIT_FAILURE);
}
/* Left is a positive number or zero therefore monitors with zero width are excluded */
width = bw;
for (i = 0; i < num; i++) {