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); }