[client] Escape clients name

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-23 13:22:58 +02:00
parent 0642e415dd
commit ccfcde3555
2 changed files with 8 additions and 3 deletions

View File

@ -188,12 +188,17 @@ client_get_byname(client_t *list, char *name)
void
client_updatetitle(client_t *c)
{
char buf[512];
if(!xutil_gettextprop(globalconf.connection, c->win,
xutil_intern_atom(globalconf.connection, "_NET_WM_NAME"),
c->name, sizeof(c->name)))
buf, sizeof(buf)))
xutil_gettextprop(globalconf.connection, c->win,
xutil_intern_atom(globalconf.connection, "WM_NAME"),
c->name, sizeof(c->name));
buf, sizeof(buf));
if(c->name)
p_delete(&c->name);
c->name = g_markup_escape_text(buf, -1);
titlebar_draw(c);
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
}

View File

@ -186,7 +186,7 @@ typedef struct client_t client_t;
struct client_t
{
/** Client name */
char name[256];
char *name;
/** Window geometry */
area_t geometry;
/** Floating window geometry */