Merge pull request #8 from toumorokoshi/feature/fix-tag-orphan

fix tags being orphaned by screen disconnect
This commit is contained in:
Albert Diserholt 2022-01-02 10:32:39 +01:00 committed by GitHub
commit 2a4396ea77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -44,6 +44,13 @@ local sharedtags = {
local function salvage(tag)
-- The screen to move the orphaned tag to.
local newscreen = capi.screen.primary
-- the primary screen may be the one that is being
-- removed, so try to find a different screen if possible.
for s in capi.screen do
if s ~= tag.screen then
newscreen = s
end
end
-- Make sure the tag isn't selected when moved to the new screen.
tag.selected = false