From b4c83d0e702168c5bbcf3becaad89897c3f06d70 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 23 Mar 2014 19:48:07 +0100 Subject: [PATCH] Use signals on classes instead of instances where appropriate Signed-off-by: Uli Schlachter --- awesomerc.lua.in | 16 ++++++++-------- lib/awful/client.lua.in | 6 ++---- lib/awful/tag.lua.in | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index c7ec2894..ed33a914 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -369,14 +369,6 @@ awful.rules.rules = { -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c) - -- 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 awesome.startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. @@ -435,6 +427,14 @@ client.connect_signal("manage", function (c) end 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) + client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index e6e6fa46..595cf859 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -613,9 +613,7 @@ capi.client.connect_signal("new", function(c) c:connect_signal("property::border_width", store_init_geometry) end) -capi.client.connect_signal("manage", function(c) - c:connect_signal("property::geometry", store_floating_geometry) -end) +capi.client.connect_signal("property::geometry", store_floating_geometry) --- Return if a client has a fixe size or not. -- @param c The client. @@ -958,7 +956,7 @@ capi.client.add_signal("unmarked") capi.client.connect_signal("focus", client.focus.history.add) capi.client.connect_signal("unmanage", client.focus.history.delete) -capi.client.connect_signal("manage", function(c) c:connect_signal("property::urgent", client.urgent.add) end) +capi.client.connect_signal("property::urgent", client.urgent.add) capi.client.connect_signal("focus", client.urgent.delete) capi.client.connect_signal("unmanage", client.urgent.delete) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index 2273d473..ad89dfb6 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -567,10 +567,10 @@ capi.client.connect_signal("manage", function(c, startup) c.screen = capi.mouse.screen end end - c:connect_signal("property::screen", tag.withcurrent) end) capi.client.connect_signal("manage", tag.withcurrent) +capi.client.connect_signal("property::screen", tag.withcurrent) capi.tag.connect_signal("request::select", tag.viewonly) capi.tag.add_signal("property::hide")