awful.rules: apply accumulated rule properties (FS#669)
To avoid the screen flickering, when two rules have different tags with true switchtotag. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e7819ec211
commit
148e095fa9
|
@ -81,16 +81,22 @@ end
|
|||
--- Apply rules to a client.
|
||||
-- @param c The client.
|
||||
function apply(c)
|
||||
local props = {}
|
||||
for _, entry in ipairs(rules) do
|
||||
if match(c, entry.rule) then
|
||||
for property, value in pairs(entry.properties) do
|
||||
props[property] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for property, value in pairs(props) do
|
||||
if property == "floating" then
|
||||
aclient.floating.set(c, value)
|
||||
elseif property == "tag" then
|
||||
aclient.movetotag(value, c)
|
||||
elseif property == "switchtotag" and value
|
||||
and entry.properties["tag"] then
|
||||
atag.viewonly(entry.properties["tag"])
|
||||
elseif property == "switchtotag" and value and props.tag then
|
||||
atag.viewonly(props.tag)
|
||||
elseif property == "height" or property == "width" or
|
||||
property == "x" or property == "y" then
|
||||
local geo = c:geometry();
|
||||
|
@ -104,12 +110,10 @@ function apply(c)
|
|||
end
|
||||
-- Do this at last so we do not erase things done by the focus
|
||||
-- signal.
|
||||
if entry.properties.focus then
|
||||
if props.focus then
|
||||
client.focus = c
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
client.add_signal("manage", apply)
|
||||
|
||||
|
|
Loading…
Reference in New Issue