On 28.04.2012 14:12, Anurag Priyam wrote:
> This should be the expected behavior, imo.  Otherwise the client doesn't 
> appear
> in tasklist regardless of being focussed.
> 
> Signed-off-by: Anurag Priyam <[email protected]>
> ---
>  lib/awful/client.lua.in |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in
> index 79d5fa9..3795766 100644
> --- a/lib/awful/client.lua.in
> +++ b/lib/awful/client.lua.in
> @@ -939,6 +939,9 @@ capi.client.connect_signal("manage", function(c)
> c:connect_signal("property::urg
>  capi.client.connect_signal("focus", urgent.delete)
>  capi.client.connect_signal("unmanage", urgent.delete)
> 
> +-- un-hide the client when it regains focus
> +capi.client.connect_signal("focus", function (c) c.hidden = false end)
> +
>  capi.client.connect_signal("unmanage", floating.delete)
> 
>  -- vim: 
> filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

Let's keep our hacks together in one place. Could you test the attached patch?
(We already do the same thing to unset the minimized state when a client gets
focused, so IMHO that's also where we should unset the hidden state)

Thanks,
Uli
-- 
- Captain, I think I should tell you I've never
  actually landed a starship before.
- That's all right, Lieutenant, neither have I.
diff --git a/objects/client.c b/objects/client.c
index 67c7079..dcdae0d 100644
--- a/objects/client.c
+++ b/objects/client.c
@@ -669,6 +669,26 @@ client_set_minimized(lua_State *L, int cidx, bool s)
     }
 }
 
+/** Set a client hidden, or not.
+ * \param L The Lua VM state.
+ * \param cidx The client index.
+ * \param s Set or not the client hidden.
+ */
+static void
+client_set_hidden(lua_State *L, int cidx, bool b)
+{
+    client_t *c = luaA_checkudata(L, cidx, &client_class);
+
+    if(b != c->hidden)
+    {
+        c->hidden = b;
+        banning_need_update();
+        if(strut_has_value(&c->strut))
+            screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0);
+        luaA_object_emit_signal(L, -3, "property::hidden", 0);
+    }
+}
+
 /** Set a client sticky, or not.
  * \param L The Lua VM state.
  * \param cidx The client index.
@@ -850,9 +870,10 @@ client_unban(client_t *c)
 
         c->isbanned = false;
 
-        /* An unbanned clients shouldn't be minimized */
+        /* An unbanned client shouldn't be minimized nor hidden */
         luaA_object_push(globalconf.L, c);
         client_set_minimized(globalconf.L, -1, false);
+        client_set_hidden(globalconf.L, -1, false);
         lua_pop(globalconf.L, 1);
     }
 }
@@ -1233,15 +1254,7 @@ luaA_client_set_screen(lua_State *L, client_t *c)
 static int
 luaA_client_set_hidden(lua_State *L, client_t *c)
 {
-    bool b = luaA_checkboolean(L, -1);
-    if(b != c->hidden)
-    {
-        c->hidden = b;
-        banning_need_update();
-        if(strut_has_value(&c->strut))
-            screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0);
-        luaA_object_emit_signal(L, -3, "property::hidden", 0);
-    }
+    client_set_hidden(L, -3, luaA_checkboolean(L, -1));
     return 0;
 }
 

Reply via email to