From 6430738f1744c5734da6f5a7177b2ef33c0f9265 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 14 Mar 2009 13:47:50 +0100 Subject: [PATCH] client: stop using otable Signed-off-by: Julien Danjou --- client.c | 2 +- lib/awful/widget/taglist.lua.in | 14 +++++++++++--- lib/awful/widget/tasklist.lua.in | 9 +++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client.c b/client.c index bb4350a1..0d90112d 100644 --- a/client.c +++ b/client.c @@ -1322,7 +1322,7 @@ luaA_client_tags(lua_State *L) } tags = &globalconf.screens[(*c)->screen].tags; - luaA_otable_new(L); + lua_newtable(L); for(int i = 0; i < tags->len; i++) if(is_client_tagged(*c, tags->tab[i])) { diff --git a/lib/awful/widget/taglist.lua.in b/lib/awful/widget/taglist.lua.in index 4d339b9d..5f8f2642 100644 --- a/lib/awful/widget/taglist.lua.in +++ b/lib/awful/widget/taglist.lua.in @@ -12,6 +12,7 @@ local capi = { widget = widget, local otable = otable local type = type local pairs = pairs +local ipairs = ipairs local hooks = require("awful.hooks") local common = require("awful.widget.common") local util = require("awful.util") @@ -108,10 +109,17 @@ function label.all(t, args) bg_color = bg_focus fg_color = fg_focus end - if sel and sel:tags()[t] then + if sel then if taglist_squares_sel then - bg_image = capi.image(taglist_squares_sel) - bg_resize = taglist_squares_resize == "true" + -- Check that the selected clients is tagged with 't'. + local seltags = sel:tags() + for _, v in ipairs(seltags) do + if v == t then + bg_image = capi.image(taglist_squares_sel) + bg_resize = taglist_squares_resize == "true" + break + end + end end else local cls = t:clients() diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in index 3f94ec21..eae23ef1 100644 --- a/lib/awful/widget/tasklist.lua.in +++ b/lib/awful/widget/tasklist.lua.in @@ -167,8 +167,13 @@ function label.currenttags(c, screen, args) -- Only print client on the same screen as this widget if c.screen ~= screen then return end for k, t in ipairs(capi.screen[screen]:tags()) do - if t.selected and c:tags()[t] then - return widget_tasklist_label_common(c, args) + if t.selected then + local ctags = c:tags() + for _, v in ipairs(ctags) do + if v == t then + return widget_tasklist_label_common(c, args) + end + end end end end