client: Remove XFetchName, replace by XGetWindowProperty for get a client title utf8.
This commit is contained in:
parent
c68aa48bc2
commit
9331a9662f
11
src/client.c
11
src/client.c
@ -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");
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user