xproperty: Emit on "awesome" for root window properties
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
ec484b700a
commit
c7e32429b8
25
property.c
25
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue