Use XAllocNamedColor to translate string color
This commit is contained in:
parent
04c3b9362e
commit
980832b474
@ -49,9 +49,12 @@
|
|||||||
static inline Color
|
static inline Color
|
||||||
color_atoh(const char *col)
|
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
|
static inline void
|
||||||
|
|||||||
@ -319,10 +319,14 @@ wmfs_scan(void)
|
|||||||
|
|
||||||
tag_client(tag_gb_id(c->screen, tag), c);
|
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);
|
client_moveresize(c, &g);
|
||||||
|
/* In a removed tag */
|
||||||
else
|
else
|
||||||
layout_split_integrate(c, NULL);
|
{
|
||||||
|
c->geo = g;
|
||||||
|
layout_client(c);
|
||||||
|
}
|
||||||
|
|
||||||
client_get_name(c);
|
client_get_name(c);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user