activate: Merge the old hardcoded focus filter with awful.ewmh one.

This code was attached to mouse::enter in `rc.lua` instead of being part
of the unified request::activate architecture.

There is currently no way to detach this focus filter because it is
generally correct.
This commit is contained in:
Emmanuel Lepage Vallee 2018-07-29 18:04:12 -04:00
parent 26e4856821
commit 091adca070
1 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,7 @@ local aclient = require("awful.client")
local aplace = require("awful.placement")
local asuit = require("awful.layout.suit")
local beautiful = require("beautiful")
local alayout = require("awful.layout")
local ewmh = {
generic_activate_filters = {},
@ -400,6 +401,15 @@ function ewmh.client_geometry_requests(c, context, hints)
end
end
-- The magnifier layout doesn't work with focus follow mouse.
ewmh.add_activate_filter(function(c)
if alayout.get(c.screen) ~= alayout.suit.magnifier
and aclient.focus.filter(c) then
return nil
else
return false
end
end, "mouse_enter")
client.connect_signal("request::activate", ewmh.activate)
client.connect_signal("request::tag", ewmh.tag)