From dafcc68427d7552fed59c10bd31b177c846d5ab0 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 10 Feb 2011 17:04:26 +0100 Subject: [PATCH] Send correct signals when c.name updates When a client sets WM_NAME (client->alt_name) but doesn't set _NET_WM_NAME (client->name), we give alt_name to lua when c.name is used. However, we still emitted property::alt_name instead of property::name to lua. Obviously, this breaks stuff. (The same applies to client->alt_icon_name) I noticed this via feh whose tasklist entry wasn't refreshed when multiple images were displayed and I switched to the next one. Signed-off-by: Uli Schlachter --- objects/client.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/objects/client.c b/objects/client.c index e4ba2dd27..5934822fd 100644 --- a/objects/client.c +++ b/objects/client.c @@ -103,19 +103,21 @@ DO_CLIENT_SET_PROPERTY(pid) DO_CLIENT_SET_PROPERTY(skip_taskbar) #undef DO_CLIENT_SET_PROPERTY -#define DO_CLIENT_SET_STRING_PROPERTY(prop) \ +#define DO_CLIENT_SET_STRING_PROPERTY2(prop, signal) \ void \ client_set_##prop(lua_State *L, int cidx, char *value) \ { \ client_t *c = luaA_checkudata(L, cidx, &client_class); \ p_delete(&c->prop); \ c->prop = value; \ - luaA_object_emit_signal(L, cidx, "property::" #prop, 0); \ + luaA_object_emit_signal(L, cidx, "property::" #signal, 0); \ } +#define DO_CLIENT_SET_STRING_PROPERTY(prop) \ + DO_CLIENT_SET_STRING_PROPERTY2(prop, prop) DO_CLIENT_SET_STRING_PROPERTY(name) -DO_CLIENT_SET_STRING_PROPERTY(alt_name) +DO_CLIENT_SET_STRING_PROPERTY2(alt_name, name) DO_CLIENT_SET_STRING_PROPERTY(icon_name) -DO_CLIENT_SET_STRING_PROPERTY(alt_icon_name) +DO_CLIENT_SET_STRING_PROPERTY2(alt_icon_name, icon_name) DO_CLIENT_SET_STRING_PROPERTY(role) DO_CLIENT_SET_STRING_PROPERTY(machine) #undef DO_CLIENT_SET_STRING_PROPERTY @@ -1851,8 +1853,6 @@ client_class_setup(lua_State *L) signal_add(&client_class.signals, "mouse::enter"); signal_add(&client_class.signals, "mouse::leave"); signal_add(&client_class.signals, "property::above"); - signal_add(&client_class.signals, "property::alt_icon_name"); - signal_add(&client_class.signals, "property::alt_name"); signal_add(&client_class.signals, "property::below"); signal_add(&client_class.signals, "property::class"); signal_add(&client_class.signals, "property::fullscreen");