From c26d5242d556bce70a954e9993a8d548f1b974fb Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 27 Jan 2008 18:59:12 +0100 Subject: [PATCH] use draw_color_new() --- awesome-message.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/awesome-message.c b/awesome-message.c index 2e0e4757a..45c12918b 100644 --- a/awesome-message.c +++ b/awesome-message.c @@ -41,7 +41,7 @@ main(int argc, char **argv) Display *disp; SimpleWindow *sw; DrawCtx *ctx; - XColor fg, bg, c; + XColor fg, bg; XEvent ev; Bool running = True; const char *fg_color = "#000000"; @@ -105,12 +105,9 @@ main(int argc, char **argv) ctx = draw_get_context(disp, DefaultScreen(disp), geometry.width, geometry.height, sw->drawable); - /* XXX replace by initxcolor() */ - XAllocNamedColor(disp, DefaultColormap(disp, DefaultScreen(disp)), - bg_color, &bg, &c); - XAllocNamedColor(disp, DefaultColormap(disp, DefaultScreen(disp)), - fg_color, &fg, &c); + bg = draw_color_new(disp, DefaultScreen(disp), bg_color); + fg = draw_color_new(disp, DefaultScreen(disp), fg_color); geometry.x = geometry.y = 0; draw_text(ctx, geometry, AlignRight,