JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
revert getstate change. made windows disappear.
[spectrwm.git] / spectrwm.c
index e976c4b..c8daa81 100644 (file)
@@ -1988,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;
 
@@ -1995,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);
        }
 
@@ -3890,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");
@@ -3943,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);