client: emit class signal on focus
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
ee1a3f24d7
commit
cb2cad6b09
3
client.c
3
client.c
|
@ -317,6 +317,9 @@ client_focus_update(client_t *c)
|
||||||
client_push(globalconf.L, c);
|
client_push(globalconf.L, c);
|
||||||
luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.focus, 1, 0);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -830,11 +830,11 @@ function property.set(c, prop, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register standards hooks
|
-- Register standards hooks
|
||||||
hooks.focus.register(focus.history.add)
|
capi.client.add_signal("focus", focus.history.add)
|
||||||
hooks.unmanage.register(focus.history.delete)
|
hooks.unmanage.register(focus.history.delete)
|
||||||
|
|
||||||
hooks.property.register(urgent.add)
|
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(urgent.delete)
|
||||||
|
|
||||||
hooks.unmanage.register(floating.delete)
|
hooks.unmanage.register(floating.delete)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local type = type
|
local type = type
|
||||||
|
local capi = { screen = screen, client = client }
|
||||||
local tag = require("awful.tag")
|
local tag = require("awful.tag")
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
local suit = require("awful.layout.suit")
|
local suit = require("awful.layout.suit")
|
||||||
|
@ -131,7 +132,7 @@ hooks.wibox_position.register(function(wibox)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hooks.padding.register(function(screen) on_arrange(screen) 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()
|
hooks.clients.register(function()
|
||||||
for screen = 1, capi.screen.count() do
|
for screen = 1, capi.screen.count() do
|
||||||
on_arrange(screen)
|
on_arrange(screen)
|
||||||
|
|
|
@ -409,7 +409,7 @@ button_groups = { close_buttons,
|
||||||
floating_buttons }
|
floating_buttons }
|
||||||
|
|
||||||
-- Register standards hooks
|
-- Register standards hooks
|
||||||
hooks.focus.register(update)
|
capi.client.add_signal("focus", update)
|
||||||
hooks.unfocus.register(update)
|
hooks.unfocus.register(update)
|
||||||
hooks.property.register(update)
|
hooks.property.register(update)
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ function new(screen, label, buttons)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local uc = function (c) return u(c.screen) 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.unfocus.register(uc)
|
||||||
hooks.tags.register(u)
|
hooks.tags.register(u)
|
||||||
hooks.tagged.register(uc)
|
hooks.tagged.register(uc)
|
||||||
|
|
|
@ -58,7 +58,7 @@ function new(label, buttons)
|
||||||
hooks.tags.register(u)
|
hooks.tags.register(u)
|
||||||
hooks.clients.register(u)
|
hooks.clients.register(u)
|
||||||
hooks.tagged.register(u)
|
hooks.tagged.register(u)
|
||||||
hooks.focus.register(u)
|
capi.client.add_signal("focus", u)
|
||||||
hooks.unfocus.register(u)
|
hooks.unfocus.register(u)
|
||||||
hooks.property.register(function (c, prop)
|
hooks.property.register(function (c, prop)
|
||||||
if type(c) ~= "client" then return end
|
if type(c) ~= "client" then return end
|
||||||
|
|
Loading…
Reference in New Issue