From 025b2841da655eeaed353c0dd880557d2c5e2c23 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 24 Feb 2015 15:33:49 +0100 Subject: [PATCH] autofocus: emit `request::activate` signal After a client gets unmanaged, the newly focused client might not be visible / raised above other windows. Using the `request::activate` signal makes the autofocus handler more flexible, and will raise the focused client by default. --- lib/awful/autofocus.lua.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/awful/autofocus.lua.in b/lib/awful/autofocus.lua.in index 04795ee94..091967a32 100644 --- a/lib/awful/autofocus.lua.in +++ b/lib/awful/autofocus.lua.in @@ -20,7 +20,9 @@ local function check_focus(obj) -- When no visible client has the focus... 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 + if c then + c:emit_signal('request::activate', "autofocus.check_focus") + end end end @@ -38,7 +40,9 @@ local function check_focus_tag(t) check_focus({ screen = s }) if client.focus and client.focus.screen ~= s then local c = aclient.focus.history.get(s, 0) - if c then client.focus = c end + if c then + c:emit_signal('request::activate', "autofocus.check_focus_tag") + end end end