$OpenBSD: patch-lib_awful_tag_lua_in,v 1.3 2014/01/14 13:33:37 dcoppa Exp $

commit d4b12bb1b2b8365d7c1b9be365dc5843303ba828
Author: Uli Schlachter <psychon@znc.in>
Date:   Sat Nov 23 14:54:13 2013 +0100

awful.tag.delete: Deactivate tags

The activated property was added to tag objects between awesome 3.4 and 3.5.
This is used in the C code to keep tags alive even when nothing else refers to
it and includes a tag e.g. in some root window properties.

Thus, to get rid of a tag and to make the C code drop its reference to it, we
have to set activated to false in this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>

commit 5cd8c7e540c91b575581c7958ec82903bb646058
Author: Uli Schlachter <psychon@znc.in>
Date:   Mon Dec 30 11:33:09 2013 +0100

awful.tag.viewmore: Make screen optional (FS#1203)

The documentation says that screen, the last argument to viewmore(), is an
optional argument. However, the implementation only treated it as an optional
argument in one place.

Fix this by always setting the screen variable itself to a screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>

--- lib/awful/tag.lua.in.orig	Tue Jan 14 10:23:58 2014
+++ lib/awful/tag.lua.in	Tue Jan 14 10:30:35 2014
@@ -154,6 +154,7 @@ function tag.delete(target_tag, fallback_tag)
 
     -- delete the tag
     data.tags[target_tag].screen = nil
+    target_tag.activated = false
 
     -- If no tags are visible, try and view one.
     if tag.selected(target_scr) == nil and ntags > 0 then
@@ -466,7 +467,8 @@ end
 -- @param tags A table with tags to view only.
 -- @param screen Optional screen number of the tags.
 function tag.viewmore(tags, screen)
-    local screen_tags = tag.gettags(screen or capi.mouse.screen)
+    local screen = screen or capi.mouse.screen
+    local screen_tags = tag.gettags(screen)
     for _, _tag in ipairs(screen_tags) do
         if not util.table.hasitem(tags, _tag) then
             _tag.selected = false
