workspace: Delete empty tag at end of main loop

Prevents the previous tag in history from being selected.
This commit is contained in:
James Reed 2020-08-01 17:28:19 -06:00
parent a768a20b06
commit ce4127d6e7
No known key found for this signature in database
GPG Key ID: 0BE2BD33C5E8125E
1 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,7 @@
local awful = require("awful")
local naughty = require("naughty")
local gtable = require("gears.table")
local gtimer = require("gears.timer")
local launch = require("awesome-launch")
local ws = {}
@ -145,10 +146,12 @@ function ws.new(name, args)
local tag = awful.tag.add(name, props)
tag:connect_signal("property::selected", function ()
gtimer.delayed_call(function ()
if tag.volatile and not tag.selected and #tag:clients() == 0 then
tag:delete()
end
end)
end)
return handle_args(tag, args)
end