workspace: Don't use volatile tags

Instead manually delete tag if it has no clients and is not
selected.
This commit is contained in:
James Reed 2020-10-05 16:34:28 -06:00
parent 6b4df07705
commit 63e552f0e3
No known key found for this signature in database
GPG Key ID: 0BE2BD33C5E8125E
1 changed files with 6 additions and 4 deletions

View File

@ -102,7 +102,6 @@ end
function ws.new(name, args)
local props = {
screen = awful.screen.focused(),
volatile = true,
layout = awful.layout.layouts[1],
}
if args and args.props then
@ -110,13 +109,16 @@ function ws.new(name, args)
end
local tag = awful.tag.add(name, props)
tag:connect_signal("property::selected", function ()
local function delete()
gtimer.delayed_call(function ()
if tag.volatile and not tag.selected and #tag:clients() == 0 then
if not tag.selected and #tag:clients() == 0 then
tag:delete()
end
end)
end)
end
tag:connect_signal("property::selected", delete)
tag:connect_signal("untagged", delete)
return handle_args(tag, args)
end