client: Remove XFetchName, replace by XGetWindowProperty for get a client title utf8.

This commit is contained in:
Martin Duquesnoy 2009-02-14 19:52:53 +01:00
parent c68aa48bc2
commit 9331a9662f
2 changed files with 13 additions and 3 deletions

View File

@ -236,7 +236,16 @@ client_focus(Client *c)
void
client_get_name(Client *c)
{
XFetchName(dpy, c->win, &(c->title));
Atom rt;
int rf;
ulong ir, il;
if(XGetWindowProperty(dpy, c->win, net_atom[net_wm_name], 0, 4096,
False, net_atom[utf8_string], &rt, &rf, &ir, &il, (uchar**)&c->title) != Success)
XGetWindowProperty(dpy, c->win, ATOM("WM_NAME"), 0, 4096,
False, net_atom[utf8_string], &rt, &rf, &ir, &il, (uchar**)&c->title);
/* If there is no title... */
if(!c->title)
c->title = _strdup("WMFS");

View File

@ -191,10 +191,11 @@ frame_update(Client *c)
XClearWindow(dpy, c->bottom);
if(TBARH && (TBARH + BORDH + 1) > font->height)
{
barwin_draw_text(c->titlebar, (c->frame_geo.width / 2) - (textw(c->title) / 2),
(font->height - (font->descent)) + (((TBARH + BORDH) - font->height) / 2),
c->title);
strdup(c->title));
}
return;
}