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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-02-10 17:04:26 +01:00
parent 3b0a20ca3b
commit dafcc68427
1 changed files with 6 additions and 6 deletions

View File

@ -103,19 +103,21 @@ DO_CLIENT_SET_PROPERTY(pid)
DO_CLIENT_SET_PROPERTY(skip_taskbar) DO_CLIENT_SET_PROPERTY(skip_taskbar)
#undef DO_CLIENT_SET_PROPERTY #undef DO_CLIENT_SET_PROPERTY
#define DO_CLIENT_SET_STRING_PROPERTY(prop) \ #define DO_CLIENT_SET_STRING_PROPERTY2(prop, signal) \
void \ void \
client_set_##prop(lua_State *L, int cidx, char *value) \ client_set_##prop(lua_State *L, int cidx, char *value) \
{ \ { \
client_t *c = luaA_checkudata(L, cidx, &client_class); \ client_t *c = luaA_checkudata(L, cidx, &client_class); \
p_delete(&c->prop); \ p_delete(&c->prop); \
c->prop = value; \ 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(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(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(role)
DO_CLIENT_SET_STRING_PROPERTY(machine) DO_CLIENT_SET_STRING_PROPERTY(machine)
#undef DO_CLIENT_SET_STRING_PROPERTY #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::enter");
signal_add(&client_class.signals, "mouse::leave"); signal_add(&client_class.signals, "mouse::leave");
signal_add(&client_class.signals, "property::above"); 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::below");
signal_add(&client_class.signals, "property::class"); signal_add(&client_class.signals, "property::class");
signal_add(&client_class.signals, "property::fullscreen"); signal_add(&client_class.signals, "property::fullscreen");