client: Ignore "fake" string property changes

I noticed high CPU usage while using asunder. The reason was that asunder
re-sets its window name every 0.1 seconds (and awesome's drawing code is way too
slow).

A semi-fix for this is to ignore string property changes if the old and new
value for the property are equal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-08-01 11:48:03 +02:00
parent 14722aa6e4
commit a0e45e878e
1 changed files with 5 additions and 0 deletions

View File

@ -113,6 +113,11 @@ DO_CLIENT_SET_PROPERTY(skip_taskbar)
client_set_##prop(lua_State *L, int cidx, char *value) \
{ \
client_t *c = luaA_checkudata(L, cidx, &client_class); \
if (A_STREQ(c->prop, value)) \
{ \
p_delete(&value); \
return; \
} \
p_delete(&c->prop); \
c->prop = value; \
luaA_object_emit_signal(L, cidx, "property::" #signal, 0); \