-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi list,

I recently noticed some bug in my config which caused me to look a little closer
at the tasklist. Here I found the following code (u() updates the tasklist that
is being created in this function):

    for s = 1, capi.screen.count() do
        tag.attached_add_signal(s, "property::filtered", u)
        capi.screen[s]:add_signal("tag::attach", u)
        capi.screen[s]:add_signal("tag::detach", u)
        capi.screen[s]:add_signal("tag::history::update", u)
    end

There doesn't seem to be a "filtered" property and I don't see why the
*task*list should update when new tags show up or old ones go away. Well, ok,
when a tag which had some clients assigned, the tasklist might need to update.
Looking at the C code, "detach" is the only signal we get in that case...
Also, what does the tasklist care about the tag history?

Does anyone mind if that code is just dropped?


The bug I noticed was that the tasklist does not get updated when one selects
new tags by right-clicking in the taglist. This does not happen with the default
config. Some code reading revealed:

My code:
        awful.button({ }, 3, function (tag)
                tag.selected = not tag.selected
        end),

Default config:
        awful.button({ }, 3, awful.tag.viewtoggle),

(viewtoggle() emits tag::history::update)
My plan was to make the tasklist instead listen on property::selected.

Does anyone see a problem with these two changes? Patch is attached.

Cheers,
Uli
- -- 
- - Buck, when, exactly, did you lose your mind?
- - Three months ago. I woke up one morning married to a pineapple.
  An ugly pineapple... But I loved her!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBCAAGBQJMIM0DAAoJECLkKOvLj8sGRg4IANJpkr3jb5w8WHadNU5DLu4y
Zam40B2Z2A4YTnb0lVtLBncG/HiCZ6gnwav6QHjvp+WvCGECdAggYz8p5dNXTPEP
F9E9PnUlolucIOZO5nIMOTjTzf6a80tsDvlGKi+pZYfAQzhUzGZ+x8wPYFEM8aCq
ntwVeMiCGvnGhJC5ZoXM/PazbyS2JpB+4IJbXCMV12BK6RLiGV4VxyDGP02m5dun
w1MaRq6cQU0GZL24GSv1BcDi6ZbeLEYDpat8b4mwdNhlj0dDcYC9eqSN3rVAQAMs
+EnQG//tllpL/vf4ZVGHRSJ/s4Vh4HDCGDQvwjImFlCQrNi0wAl0jWN/ZnVck0I=
=A5v6
-----END PGP SIGNATURE-----
>From 2e0ea80cb3ee5aa7006a6f48fce4d15c551b51ab Mon Sep 17 00:00:00 2001
From: Uli Schlachter <psyc...@znc.in>
Date: Tue, 22 Jun 2010 16:45:06 +0200
Subject: [PATCH] Tasklist: Listen to the correct signals

The tasklist shouldn't care about the tag history or new tags showing up and it
also shouldn't care about tags disappearing on other screens (on the current
screen the tasklist needs to update because the tag might have been selected).

On the other hand, the tasklist really should care about tags being selected and
unselected. This worked before because this causes changes to the focus history.

Signed-off-by: Uli Schlachter <psyc...@znc.in>
---
 lib/awful/widget/tasklist.lua.in |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in
index e41c405..dd813e6 100644
--- a/lib/awful/widget/tasklist.lua.in
+++ b/lib/awful/widget/tasklist.lua.in
@@ -135,12 +135,8 @@ function new(screen, filter, buttons, style, template)
 
     local data = setmetatable({}, { __mode = 'k' })
     local u = function () tasklist_update(screen, w, buttons, filter, data, style, template) end
-    for s = 1, capi.screen.count() do
-        tag.attached_add_signal(s, "property::filtered", u)
-        capi.screen[s]:add_signal("tag::attach", u)
-        capi.screen[s]:add_signal("tag::detach", u)
-        capi.screen[s]:add_signal("tag::history::update", u)
-    end
+    capi.screen[screen]:add_signal("tag::detach", u)
+    tag.attached_add_signal(screen, "property::selected", u)
     capi.client.add_signal("new", function (c)
         c:add_signal("property::urgent", u)
         c:add_signal("property::floating", u)
-- 
1.7.1

Attachment: 0001-Tasklist-Listen-to-the-correct-signals.patch.sig
Description: Binary data

Reply via email to