mirror of https://github.com/0intro/wmii
patch for Benderunit to check UTF8 issues
This commit is contained in:
parent
adcab2b78a
commit
94a12749cb
|
@ -32,7 +32,7 @@ update_client_name(Client *c)
|
|||
if(name.encoding == XA_STRING)
|
||||
cext_strlcpy(c->name, (char *)name.value, sizeof(c->name));
|
||||
else {
|
||||
if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
|
||||
if(Xutf8TextPropertyToTextList(dpy, &name, &list, &n) >= Success
|
||||
&& n > 0 && *list)
|
||||
{
|
||||
cext_strlcpy(c->name, *list, sizeof(c->name));
|
||||
|
|
|
@ -102,8 +102,8 @@ xdrawtext(Display *dpy, BlitzDraw *d)
|
|||
}
|
||||
XSetBackground(dpy, d->gc, d->color.bg);
|
||||
XSetForeground(dpy, d->gc, d->color.fg);
|
||||
if(d->font.set)
|
||||
XmbDrawString(dpy, d->drawable, d->font.set, d->gc, x, y, text, len);
|
||||
if(0&&d->font.set)
|
||||
Xutf8DrawString(dpy, d->drawable, d->font.set, d->gc, x, y, text, len);
|
||||
else
|
||||
XDrawString(dpy, d->drawable, d->gc, x, y, text, len);
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ unsigned int
|
|||
blitz_textwidth(Display *dpy, BlitzFont *font, char *text)
|
||||
{
|
||||
XRectangle r;
|
||||
if(font->set) {
|
||||
XmbTextExtents(font->set, text, strlen(text), nil, &r);
|
||||
if(0&&font->set) {
|
||||
Xutf8TextExtents(font->set, text, strlen(text), nil, &r);
|
||||
return r.width;
|
||||
}
|
||||
return XTextWidth(font->xfont, text, strlen(text));
|
||||
|
|
Loading…
Reference in New Issue