rules.tag: Prevent a screen mismatch
As c:tags() doesn't (cannot) check for screen mismatch, then it
has to be done.
This is a follow up of 6f7019b2d0
, see #1236.
This commit is contained in:
parent
08892d5a20
commit
c96aa9866e
|
@ -267,12 +267,18 @@ local force_ignore = {
|
||||||
border_width=true,floating=true,size_hints_honor=true
|
border_width=true,floating=true,size_hints_honor=true
|
||||||
}
|
}
|
||||||
|
|
||||||
function rules.high_priority_properties.tag(c, value)
|
function rules.high_priority_properties.tag(c, value, props)
|
||||||
if value then
|
if value then
|
||||||
if type(value) == "string" then
|
if type(value) == "string" then
|
||||||
value = atag.find_by_name(c.screen, value)
|
value = atag.find_by_name(c.screen, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- In case the tag has been forced to another screen, move the client
|
||||||
|
if c.screen ~= value.screen then
|
||||||
|
c.screen = value.screen
|
||||||
|
props.screen = value.screen -- In case another rule query it
|
||||||
|
end
|
||||||
|
|
||||||
c:tags{ value }
|
c:tags{ value }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -372,8 +378,13 @@ end
|
||||||
|
|
||||||
function rules.extra_properties.tags(c, value)
|
function rules.extra_properties.tags(c, value)
|
||||||
local current = c:tags()
|
local current = c:tags()
|
||||||
|
|
||||||
|
if #current == 0 or (value[1] and value[1].screen ~= current[1].screen) then
|
||||||
|
c:tags(value)
|
||||||
|
else
|
||||||
c:tags(util.table.merge(current, value))
|
c:tags(util.table.merge(current, value))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Apply properties and callbacks to a client.
|
--- Apply properties and callbacks to a client.
|
||||||
-- @client c The client.
|
-- @client c The client.
|
||||||
|
|
Loading…
Reference in New Issue