Put geometry checks after width/height adjust
This commit is contained in:
parent
caf14a0ec4
commit
e81c1ff8cb
13
bar.c
13
bar.c
|
@ -578,19 +578,18 @@ monitor_create_chain (xcb_rectangle_t *rects, const int num)
|
||||||
height = h;
|
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)
|
if (bw < 0)
|
||||||
bw = width - bx;
|
bw = width - bx;
|
||||||
|
|
||||||
if (bh < 0 || bh > height)
|
if (bh < 0 || bh > height)
|
||||||
bh = main_font->height + bu + 2;
|
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 */
|
/* Left is a positive number or zero therefore monitors with zero width are excluded */
|
||||||
width = bw;
|
width = bw;
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user