From 00e9af11b892800a503b7b817f0f1e2eef873410 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 8 Jul 2008 18:04:08 +0200 Subject: [PATCH] client: fix title update Signed-off-by: Julien Danjou --- client.c | 13 +++++++------ client.h | 2 +- event.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client.c b/client.c index f37a1f6b..014d2542 100644 --- a/client.c +++ b/client.c @@ -147,21 +147,23 @@ client_getbywin(xcb_window_t w) /** Update client name attribute with its new title. * \param c The client. - * \param atom The atom to use to get the name. * \param Return true if it has been updated. */ bool -client_updatetitle(client_t *c, xcb_atom_t atom) +client_updatetitle(client_t *c) { char *name; ssize_t len; - if(!xutil_gettextprop(globalconf.connection, c->win, atom, &name, &len)) - return false; + if(!xutil_gettextprop(globalconf.connection, c->win, _NET_WM_NAME, &name, &len)) + if(!xutil_gettextprop(globalconf.connection, c->win, WM_NAME, &name, &len)) + return false; p_delete(&c->name); a_iso2utf8(&c->name, name, len); + c->name = name; + /* call hook */ luaA_client_userdata_new(globalconf.L, c); luaA_dofunction(globalconf.L, globalconf.hooks.titleupdate, 1); @@ -424,8 +426,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int screen) client_raise(c); /* update window title */ - if(!client_updatetitle(c, _NET_WM_NAME)) - client_updatetitle(c, WM_NAME); + client_updatetitle(c); ewmh_update_net_client_list(c->phys_screen); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); diff --git a/client.h b/client.h index 147c4e94..a32043be 100644 --- a/client.h +++ b/client.h @@ -39,7 +39,7 @@ bool client_resize(client_t *, area_t, bool); void client_unmanage(client_t *); void client_updatewmhints(client_t *); xcb_size_hints_t *client_updatesizehints(client_t *); -bool client_updatetitle(client_t *, xcb_atom_t); +bool client_updatetitle(client_t *); void client_saveprops(client_t *); void client_kill(client_t *); void client_setfloating(client_t *, bool); diff --git a/event.c b/event.c index b7795663..84e42f92 100644 --- a/event.c +++ b/event.c @@ -531,7 +531,7 @@ event_handle_propertynotify(void *data __attribute__ ((unused)), else if (ev->atom == WM_HINTS) client_updatewmhints(c); else if(ev->atom == WM_NAME || ev->atom == _NET_WM_NAME) - client_updatetitle(c, ev->atom); + client_updatetitle(c); } return 0;