From dfd6060a53cdf7d3a372117da40a8c8eefc991f9 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 9 Jan 2010 17:23:05 +0100 Subject: [PATCH] awful.autofocus: improve client focus with multiple screens Changing screen focus to an empty tag leaves focus on a client on the previous screen, if a tag with clients is focused next the focus remains on the previous screen. Now awful.autofocus compares the tag screen and clients screen to learn if the focus should be given to a client on the focused screen. Client that gets the focus is selected from history, as usual. Signed-off-by: Adrian C. (anrxc) Signed-off-by: Julien Danjou --- lib/awful/autofocus.lua.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/awful/autofocus.lua.in b/lib/awful/autofocus.lua.in index 923fabf3..bc00adda 100644 --- a/lib/awful/autofocus.lua.in +++ b/lib/awful/autofocus.lua.in @@ -19,6 +19,9 @@ local function check_focus(obj) if not client.focus or not client.focus:isvisible() then local c = aclient.focus.history.get(obj.screen, 0) if c then client.focus = c end + elseif client.focus and client.focus.screen ~= obj.screen then + local c = aclient.focus.history.get(obj.screen, 0) + if c then client.focus = c end end end