diff --git a/src/util.h b/src/util.h index 3b6c82c..5a0e87c 100644 --- a/src/util.h +++ b/src/util.h @@ -49,9 +49,12 @@ static inline Color color_atoh(const char *col) { - int shift = (col[0] == '#'); + XColor xcolor; - return (Color)strtol(col + shift, NULL, 16); + if(!XAllocNamedColor(W->dpy, DefaultColormap(W->dpy, W->xscreen), col, &xcolor, &xcolor)) + warnl("Error: cannot allocate color \"%s\".", col); + + return xcolor.pixel; } static inline void diff --git a/src/wmfs.c b/src/wmfs.c index 3eb9d77..024815a 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -319,10 +319,14 @@ wmfs_scan(void) tag_client(tag_gb_id(c->screen, tag), c); - if(getg && tag <= TAILQ_LAST(&c->screen->tags, tsub)->id) + if(getg && tag <= TAILQ_LAST(&c->screen->tags, tsub)->id - 1) client_moveresize(c, &g); + /* In a removed tag */ else - layout_split_integrate(c, NULL); + { + c->geo = g; + layout_client(c); + } client_get_name(c); }