From a0e45e878e450d890a0ab541d48d8dd6c1ede943 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 1 Aug 2013 11:48:03 +0200 Subject: [PATCH] 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 --- objects/client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/objects/client.c b/objects/client.c index caefe80c0..b858622c7 100644 --- a/objects/client.c +++ b/objects/client.c @@ -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); \