Fix tag screen switching
The bugs this fix are: * Invalid request using nil as screen * Stop messing indexes in the old screen * Prevent c.screen <-> t.screen mismatch * Prevent no tags being selected in the old screen
This commit is contained in:
parent
d91d36c69c
commit
8bddba170b
|
@ -270,7 +270,22 @@ end
|
||||||
-- @param t tag object
|
-- @param t tag object
|
||||||
-- @param s Screen number
|
-- @param s Screen number
|
||||||
function tag.setscreen(t, s)
|
function tag.setscreen(t, s)
|
||||||
|
local s = s or capi.mouse.screen
|
||||||
|
|
||||||
|
-- Keeping the old index make very little sense when changing screen
|
||||||
|
tag.setproperty(t, "index", nil)
|
||||||
|
|
||||||
|
local old_screen = tag.getproperty(t,"screen")
|
||||||
|
|
||||||
|
-- Change the screen
|
||||||
tag.setproperty(t, "screen", s)
|
tag.setproperty(t, "screen", s)
|
||||||
|
|
||||||
|
-- Make sure the client's screen matches its tags
|
||||||
|
for k,c in ipairs(t:clients()) do
|
||||||
|
c.screen = s --Move all clients
|
||||||
|
c:tags({t})
|
||||||
|
end
|
||||||
|
tag.history.restore(old_screen,1)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get a tag's screen
|
--- Get a tag's screen
|
||||||
|
|
Loading…
Reference in New Issue