From 6fcfd45e9658f0a5a6624476601f87891f09dfc6 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 23 Mar 2014 18:23:38 +0100 Subject: [PATCH] xproperty: Emit on "awesome" for root window properties Signed-off-by: Uli Schlachter --- property.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/property.c b/property.c index 0f5bbb0d1..13c340eef 100644 --- a/property.c +++ b/property.c @@ -394,20 +394,28 @@ property_handle_propertynotify_xproperty(xcb_property_notify_event_t *ev) /* Property is not registered */ return; - obj = client_getbywin(ev->window); - if(!obj) - obj = drawin_getbywin(ev->window); - if(!obj) - return; + if (ev->window != globalconf.screen->root) + { + obj = client_getbywin(ev->window); + if(!obj) + obj = drawin_getbywin(ev->window); + if(!obj) + return; + } else + obj = NULL; /* Get us the name of the property */ buffer_inita(&buf, a_strlen(prop->name) + a_strlen("xproperty::") + 1); buffer_addf(&buf, "xproperty::%s", prop->name); /* And emit the right signal */ - luaA_object_push(globalconf.L, obj); - luaA_object_emit_signal(globalconf.L, -1, buf.s, 0); - lua_pop(globalconf.L, 1); + if (obj) + { + luaA_object_push(globalconf.L, obj); + luaA_object_emit_signal(globalconf.L, -1, buf.s, 0); + lua_pop(globalconf.L, 1); + } else + signal_object_emit(globalconf.L, &global_signals, buf.s, 0); buffer_wipe(&buf); } @@ -519,6 +527,7 @@ luaA_register_xproperty(lua_State *L) property.name = a_strdup(name); xproperty_array_insert(&globalconf.xproperties, property); signal_add(&window_class.signals, buf.s); + signal_add(&global_signals, buf.s); buffer_wipe(&buf); }