Warn the user when the area geometry is invalid

This commit is contained in:
LemonBoy 2015-10-24 14:35:36 +02:00
parent 255c93dc7a
commit 6580e2d4f7

View File

@ -29,7 +29,7 @@ typedef struct font_t {
} font_t; } font_t;
typedef struct monitor_t { typedef struct monitor_t {
int x:16, y:16, width:16; int x, y, width;
xcb_window_t window; xcb_window_t window;
xcb_pixmap_t pixmap; xcb_pixmap_t pixmap;
struct monitor_t *prev, *next; struct monitor_t *prev, *next;
@ -369,8 +369,10 @@ area_add (char *str, const char *optend, char **end, monitor_t *mon, const int x
a = &area_stack.area[i]; a = &area_stack.area[i];
// Basic safety checks // Basic safety checks
if (!a->cmd || a->align != align || a->window != mon->window) if (!a->cmd || a->align != align || a->window != mon->window) {
fprintf(stderr, "Invalid geometry for the clickable area\n");
return false; return false;
}
const int size = x - a->begin; const int size = x - a->begin;