From f5cfc03e49628a535e8ea6e33bfd827f9c4bb92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Sun, 12 Jun 2016 07:09:09 -0400 Subject: [PATCH] tag: Fix restoring invalid tags from history (#963) If: 1) An app is open in a tag 2) A new tag is created 3) The app is closed in the first tag 4) The first tag is deleted 5) The new tag is deleted Then this history would try to restore an inactive tag without a screen. Bad things will then happen. --- lib/awful/tag.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index 8ff168bd..fc1b1e60 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -395,7 +395,9 @@ function tag.history.restore(screen, idx) tag.viewnone(s) -- select tags from the history entry for _, t in ipairs(data.history[s][i]) do - t.selected = true + if t.activated and t.screen then + t.selected = true + end end -- update currently selected tags table data.history[s].current = data.history[s][i]