Fix background

This commit is contained in:
Matteo Signer 2016-04-09 17:52:51 +02:00
parent fb19fe2e49
commit c2716d9af9

View File

@ -114,6 +114,7 @@ void
update_gc (void) update_gc (void)
{ {
xcb_change_gc(c, gc[GC_DRAW], XCB_GC_FOREGROUND, (const uint32_t []){ fgc.v }); xcb_change_gc(c, gc[GC_DRAW], XCB_GC_FOREGROUND, (const uint32_t []){ fgc.v });
xcb_change_gc(c, gc[GC_DRAW], XCB_GC_BACKGROUND, (const uint32_t []){ bgc.v });
xcb_change_gc(c, gc[GC_CLEAR], XCB_GC_FOREGROUND, (const uint32_t []){ bgc.v }); xcb_change_gc(c, gc[GC_CLEAR], XCB_GC_FOREGROUND, (const uint32_t []){ bgc.v });
xcb_change_gc(c, gc[GC_ATTR], XCB_GC_FOREGROUND, (const uint32_t []){ ugc.v }); xcb_change_gc(c, gc[GC_ATTR], XCB_GC_FOREGROUND, (const uint32_t []){ ugc.v });
} }
@ -368,7 +369,7 @@ draw_icon (monitor_t *mon, int x, int align, char *filename)
fill_rect(mon->pixmap, gc[GC_CLEAR], x, by, icon->width, bh); fill_rect(mon->pixmap, gc[GC_CLEAR], x, by, icon->width, bh);
xcb_image_put(c, mon->pixmap, gc[GC_DRAW], icon->image, x, (bh-icon->height) / 2, 0); xcb_image_put(c, mon->pixmap, gc[GC_DRAW], icon->image, x, (bh-icon->height) / 2, 0);
return 0; return icon_width;
} }
rgba_t rgba_t
@ -654,6 +655,7 @@ parse (char *text)
break; break;
char filename[256]; char filename[256];
strncpy(filename, p, block_end-p); strncpy(filename, p, block_end-p);
filename[block_end-p] = '\0';
int icon_width = draw_icon(cur_mon, pos_x, align, filename); int icon_width = draw_icon(cur_mon, pos_x, align, filename);
pos_x += icon_width; pos_x += icon_width;
area_shift(cur_mon->window, align, icon_width); area_shift(cur_mon->window, align, icon_width);
@ -1302,7 +1304,7 @@ init (char *wm_name)
// Create the gc for drawing // Create the gc for drawing
gc[GC_DRAW] = xcb_generate_id(c); gc[GC_DRAW] = xcb_generate_id(c);
xcb_create_gc(c, gc[GC_DRAW], monhead->pixmap, XCB_GC_FOREGROUND, (const uint32_t []){ fgc.v }); xcb_create_gc(c, gc[GC_DRAW], monhead->pixmap, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND, (const uint32_t []){ fgc.v, bgc.v });
gc[GC_CLEAR] = xcb_generate_id(c); gc[GC_CLEAR] = xcb_generate_id(c);
xcb_create_gc(c, gc[GC_CLEAR], monhead->pixmap, XCB_GC_FOREGROUND, (const uint32_t []){ bgc.v }); xcb_create_gc(c, gc[GC_CLEAR], monhead->pixmap, XCB_GC_FOREGROUND, (const uint32_t []){ bgc.v });