From ce4127d6e7118deb0c5a975c54b1653452366443 Mon Sep 17 00:00:00 2001 From: James Reed Date: Sat, 1 Aug 2020 17:28:19 -0600 Subject: [PATCH] workspace: Delete empty tag at end of main loop Prevents the previous tag in history from being selected. --- workspace.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/workspace.lua b/workspace.lua index 8c5881e..377d39f 100644 --- a/workspace.lua +++ b/workspace.lua @@ -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,9 +146,11 @@ function ws.new(name, args) local tag = awful.tag.add(name, props) tag:connect_signal("property::selected", function () - if tag.volatile and not tag.selected and #tag:clients() == 0 then - tag:delete() - end + 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)