diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-05-29 12:12:23 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-05-29 12:12:23 +0200 |
commit | c6aee2afa3c633c5724749a71ebfc6cbaba949a5 (patch) | |
tree | 1481e26fb991407b65bc74822e3b879941171f31 | |
parent | b073f15cc8ce9644377c18812b1f968c48d3312d (diff) |
rc: move sloppy focus handling out of the manage callback
Connect the focus-setting signal statically for all clients, the way it
is done in the default rc. Might be more efficient, also does not
clutter the manage callback.
-rw-r--r-- | rc.lua | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -148,14 +148,6 @@ awful.rules.rules = { -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) - -- Enable sloppy focus - c:connect_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) - if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. @@ -184,4 +176,14 @@ end) client.connect_signal("focus", function(c) c.border_color = "#b0e2ff" end) client.connect_signal("unfocus", function(c) c.border_color = "#000000" end) + +-- Enable sloppy focus +client.connect_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) + -- }}} |