> What about replacing the withcurrent() call with a:
> capi.client.add_signal("manage", withcurrent)

These any better?

k
From afb6d08775c74f5393a73414b41ca58c657e2bc5 Mon Sep 17 00:00:00 2001
From: koniu <[email protected]>
Date: Fri, 8 Jan 2010 15:16:37 +0000
Subject: [PATCH 1/2] awful.tag: register 'withcurrent' explicitly

This explicitly registers withcurrent(c) as a manage signal handler so
that it can be removed if necessary.

Signed-off-by: koniu <[email protected]>
---
 lib/awful/tag.lua.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in
index 949a83d..a984ed5 100644
--- a/lib/awful/tag.lua.in
+++ b/lib/awful/tag.lua.in
@@ -374,10 +374,11 @@ capi.client.add_signal("manage", function(c, startup)
             c.screen = capi.mouse.screen
         end
     end
-    withcurrent(c, startup)
     c:add_signal("property::screen", withcurrent)
 end)
 
+capi.client.add_signal("manage", withcurrent)
+
 for s = 1, capi.screen.count() do
     capi.screen[s]:add_signal("tag::history::update", history.update)
 end
-- 
1.6.6

From f8cf40eca613a73b6efa084cf800a63c2a0ff336 Mon Sep 17 00:00:00 2001
From: koniu <[email protected]>
Date: Fri, 8 Jan 2010 15:26:21 +0000
Subject: [PATCH 2/2] awful.rules: tag clients without flicker (FS#664)

We unregister the default awful.tag.withcurrent 'manage' signal handler
and have awful.rules.apply handle initial client tagging.

Signed-off-by: koniu <[email protected]>
---
 lib/awful/rules.lua.in |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/awful/rules.lua.in b/lib/awful/rules.lua.in
index 5ca3c73..420ec44 100644
--- a/lib/awful/rules.lua.in
+++ b/lib/awful/rules.lua.in
@@ -112,7 +112,7 @@ function apply(c)
         if property == "floating" then
             aclient.floating.set(c, value)
         elseif property == "tag" then
-            aclient.movetotag(value, c)
+            c:tags({ value })
         elseif property == "switchtotag" and value and props.tag then
             atag.viewonly(props.tag)
         elseif property == "height" or property == "width" or
@@ -127,6 +127,11 @@ function apply(c)
         end
     end
 
+    -- If untagged, stick the client on the current one.
+    if #c:tags() == 0 then
+        atag.withcurrent(c, startup)
+    end
+
     -- Apply all callbacks from matched rules.
     for i, callback in pairs(callbacks) do
         callback(c)
@@ -140,5 +145,6 @@ function apply(c)
 end
 
 client.add_signal("manage", apply)
+client.remove_signal("manage", atag.withcurrent)
 
 -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
-- 
1.6.6

Reply via email to