X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=c8daa81a7495f683099585cd0c123eb09bb1e274;hb=f48e8c0ee9456eae06004e05b741b5d873661cd8;hp=596db238d92ef2023adc0cab897e751180b00ec2;hpb=ff9956dda8ed3a7d857646620e0392f5672e23a6;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 596db23..c8daa81 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1394,7 +1394,8 @@ bar_print(struct swm_region *r, const char *s) DefaultVisual(display, r->s->idx), DefaultColormap(display, r->s->idx)); - XftDrawStringUtf8(draw, &bar_font_color, bar_font, x, bar_font->height, + XftDrawStringUtf8(draw, &bar_font_color, bar_font, x, + (HEIGHT(r->bar) + bar_font->height) / 2 - bar_font->descent, (FcChar8 *)s, len); XftDrawDestroy(draw); @@ -1912,7 +1913,7 @@ bar_setup(struct swm_region *r) if (bar_font == NULL) errx(1, "unable to open a font"); - bar_height = bar_font->height + 4 * bar_border_width; + bar_height = bar_font->height + 2 * bar_border_width; if (bar_height < 1) bar_height = 1; @@ -1987,6 +1988,7 @@ uint16_t getstate(xcb_window_t w) { uint16_t result = 0; + uint16_t *pv; xcb_get_property_cookie_t c; xcb_get_property_reply_t *r; @@ -1994,7 +1996,8 @@ getstate(xcb_window_t w) r = xcb_get_property_reply(conn, c, NULL); if (r) { - result = *((uint16_t *)xcb_get_property_value(r)); + pv = (uint16_t *)xcb_get_property_value(r); + result = *pv; free(r); } @@ -3889,6 +3892,7 @@ search_win(struct swm_region *r, union arg *args) char s[8]; FILE *lfile; size_t len; + XftDraw *draw; XGlyphInfo info; DNPRINTF(SWM_D_MISC, "search_win\n"); @@ -3942,7 +3946,15 @@ search_win(struct swm_region *r, union arg *args) XCB_GC_BACKGROUND | XCB_GC_GRAPHICS_EXPOSURES, gcv); map_window_raised(w); - xcb_image_text_8(conn, len, w, sw->gc, 2, bar_font->height, s); + draw = XftDrawCreate(display, w, + DefaultVisual(display, r->s->idx), + DefaultColormap(display, r->s->idx)); + + XftDrawStringUtf8(draw, &bar_font_color, bar_font, 2, + (HEIGHT(r->bar) + bar_font->height) / 2 - bar_font->descent, + (FcChar8 *)s, len); + + XftDrawDestroy(draw); DNPRINTF(SWM_D_MISC, "search_win: mapped window: 0x%x\n", w);