awesomerc: change sloppy focus hook to signal

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

View File

@ -310,17 +310,8 @@ end
root.keys(globalkeys) root.keys(globalkeys)
-- }}} -- }}}
-- {{{ Hooks -- {{{ Signals
-- Hook function to execute when the mouse enters a client. -- Signal function to execute when a new client appears.
awful.hooks.mouse_enter.register(function (c)
-- Sloppy focus, but disabled for magnifier layout
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
-- Hook function to execute when a new client appears.
client.add_signal("manage", function (c, startup) client.add_signal("manage", function (c, startup)
-- If we are not managing this application at startup, -- If we are not managing this application at startup,
-- move it to the screen where the mouse is. -- move it to the screen where the mouse is.
@ -371,6 +362,14 @@ client.add_signal("manage", function (c, startup)
-- Set key bindings -- Set key bindings
c:keys(clientkeys) c:keys(clientkeys)
-- Enable sloppy focus
c:add_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
-- Set the windows at the slave, -- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master. -- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c) -- awful.client.setslave(c)