event: emit mouse::{enter,leave} on client

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-19 15:45:56 +02:00
parent 2d72e2477f
commit 341fb8e1ff
1 changed files with 10 additions and 0 deletions

10
event.c
View File

@ -416,11 +416,16 @@ event_handle_leavenotify(void *data __attribute__ ((unused)),
return 0;
if((c = client_getbytitlebarwin(ev->event)) || (c = client_getbywin(ev->event)))
{
if(globalconf.hooks.mouse_leave != LUA_REFNIL)
{
luaA_object_push(globalconf.L, c);
luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.mouse_leave, 1, 0);
}
luaA_object_push(globalconf.L, c);
luaA_object_emit_signal(globalconf.L, -1, "mouse::leave", 0);
lua_pop(globalconf.L, 1);
}
if((wibox = wibox_getbywin(ev->event)))
{
@ -473,11 +478,16 @@ event_handle_enternotify(void *data __attribute__ ((unused)),
if((c = client_getbytitlebarwin(ev->event))
|| (c = client_getbywin(ev->event)))
{
if(globalconf.hooks.mouse_enter != LUA_REFNIL)
{
luaA_object_push(globalconf.L, c);
luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.mouse_enter, 1, 0);
}
luaA_object_push(globalconf.L, c);
luaA_object_emit_signal(globalconf.L, -1, "mouse::enter", 0);
lua_pop(globalconf.L, 1);
}
return 0;
}