Convert window title to UCS-2 when updating it, don’t update it if it didn’t change

This commit is contained in:
Michael Stapelberg
2009-03-09 06:26:32 +01:00
parent 4f8e704017
commit 6df039c3b5
3 changed files with 20 additions and 6 deletions

View File

@ -169,11 +169,8 @@ void decorate_window(xcb_connection_t *conn, Client *client, xcb_drawable_t draw
uint32_t values[] = { text_color, background_color, font->id };
xcb_change_gc(conn, gc, mask, values);
int real_strlen;
char *ucs2_label = convert_utf8_to_ucs2(client->name, &real_strlen);
xcb_image_text_16(conn, real_strlen, drawable, gc, 3 /* X */,
offset + font->height /* Y = baseline of font */, (xcb_char2b_t*)ucs2_label);
free(ucs2_label);
xcb_image_text_16(conn, client->name_len, drawable, gc, 3 /* X */,
offset + font->height /* Y = baseline of font */, (xcb_char2b_t*)client->name);
}
}