diff --git a/client.c b/client.c index a5d15be3..2884e656 100644 --- a/client.c +++ b/client.c @@ -317,6 +317,9 @@ client_focus_update(client_t *c) client_push(globalconf.L, c); luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.focus, 1, 0); } + + luaA_object_push(globalconf.L, c); + luaA_class_emit_signal(globalconf.L, &client_class, "focus", 1); } diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 4f97f9ef..c4524562 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -830,11 +830,11 @@ function property.set(c, prop, value) end -- Register standards hooks -hooks.focus.register(focus.history.add) +capi.client.add_signal("focus", focus.history.add) hooks.unmanage.register(focus.history.delete) hooks.property.register(urgent.add) -hooks.focus.register(urgent.delete) +capi.client.add_signal("focus", urgent.delete) hooks.unmanage.register(urgent.delete) hooks.unmanage.register(floating.delete) diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index 96085901..3074ce56 100644 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -7,6 +7,7 @@ -- Grab environment we need local ipairs = ipairs local type = type +local capi = { screen = screen, client = client } local tag = require("awful.tag") local util = require("awful.util") local suit = require("awful.layout.suit") @@ -131,7 +132,7 @@ hooks.wibox_position.register(function(wibox) end) hooks.padding.register(function(screen) on_arrange(screen) end) -hooks.focus.register(function(c) on_arrange(c.screen) end) +capi.client.add_signal("focus", function(c) on_arrange(c.screen) end) hooks.clients.register(function() for screen = 1, capi.screen.count() do on_arrange(screen) diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in index 6d8feefc..600fe753 100644 --- a/lib/awful/titlebar.lua.in +++ b/lib/awful/titlebar.lua.in @@ -409,7 +409,7 @@ button_groups = { close_buttons, floating_buttons } -- Register standards hooks -hooks.focus.register(update) +capi.client.add_signal("focus", update) hooks.unfocus.register(update) hooks.property.register(update) diff --git a/lib/awful/widget/taglist.lua.in b/lib/awful/widget/taglist.lua.in index b63421e9..b0266542 100644 --- a/lib/awful/widget/taglist.lua.in +++ b/lib/awful/widget/taglist.lua.in @@ -65,7 +65,7 @@ function new(screen, label, buttons) end end local uc = function (c) return u(c.screen) end - hooks.focus.register(uc) + capi.client.add_signal("focus", uc) hooks.unfocus.register(uc) hooks.tags.register(u) hooks.tagged.register(uc) diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in index f1db5a40..13b3a8c5 100644 --- a/lib/awful/widget/tasklist.lua.in +++ b/lib/awful/widget/tasklist.lua.in @@ -58,7 +58,7 @@ function new(label, buttons) hooks.tags.register(u) hooks.clients.register(u) hooks.tagged.register(u) - hooks.focus.register(u) + capi.client.add_signal("focus", u) hooks.unfocus.register(u) hooks.property.register(function (c, prop) if type(c) ~= "client" then return end