From df173f7ddd27d4500558148ad2d3a93ab1737985 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 14 Mar 2015 09:06:12 +0100 Subject: [PATCH] Make client.focus = nil work (Closes #164) Signed-off-by: Uli Schlachter --- objects/client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/objects/client.c b/objects/client.c index 7332453a..7face3d9 100644 --- a/objects/client.c +++ b/objects/client.c @@ -2326,8 +2326,11 @@ luaA_client_module_newindex(lua_State *L) if (A_STREQ(buf, "focus")) { - c = luaA_checkudata(L, 3, &client_class); - client_focus(c); + c = luaA_checkudataornil(L, 3, &client_class); + if (c) + client_focus(c); + else if (globalconf.focus.client) + client_unfocus(globalconf.focus.client); } return 0;