rc.lua: Revert moving the sloppy focus to awful.permissions.

This caused a behavior change it wasn't clear how to use the
permission API to change the focus mode.

The change will only take effect if the user override the API
level.
This commit is contained in:
Emmanuel Lepage Vallee 2020-02-02 21:03:15 -05:00
parent 11f0a466b0
commit 9cbc8a18c0
4 changed files with 22 additions and 8 deletions

View File

@ -538,3 +538,8 @@ client.connect_signal("request::titlebars", function(c)
}
end)
-- }}}
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:activate { context = "mouse_enter", raise = false }
end)

View File

@ -8,8 +8,11 @@
---------------------------------------------------------------------------
require("awful.permissions._common")._deprecated_autofocus_in_use()
--require("gears.debug").deprecate(
-- "The `awful.autofocus` module is deprecated, remove the require() and "..
-- "look at the new `rc.lua` granted permission section in the client rules",
-- {deprecated_in=5}
--)
if awesome.api_level > 4 then
--TODO v5: Remove `require("awful.autofocus")` from `rc.lua`.
require("gears.debug").deprecate(
"The `awful.autofocus` module is deprecated, remove the require() and "..
"look at the new `rc.lua` granted permission section in the client rules",
{deprecated_in=5}
)
end

View File

@ -740,9 +740,14 @@ screen.connect_signal("property::workarea", function(s)
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::autoactivate", "mouse_enter", {raise=false})
end)
if awesome.api_level > 4 then
--TODO v5: Remove the code from `rc.lua`. It cannot be done yet because we
-- cannot know if the user removed it to disable sloppy focus or because
-- they want to use the permissions to manage it.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::autoactivate", "mouse_enter", {raise=false})
end)
end
return permissions

View File

@ -15,6 +15,7 @@ describe("awful.permissions.client_geometry_requests", function()
connect_signal = function() end,
}
_G.awesome = {
api_level = 4,
connect_signal = function() end,
}
_G.drawin = {