From 6dc355cf716beca1e545d6ef8ebe1d422b0064b5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 13 May 2015 13:06:53 +0200 Subject: [PATCH] autofocus: use request::focus instead of request::activate In #152 I've changed the autofocus handler to emit the request::activate signal, instead of setting client.focus only. This is wrong IMHO, and can be annoying: If you have two floating clients above a tiled / maximized one, and close one of the floating ones, with the tiled one being the one selected by autofocus, it will be raised above the other floating client. This is changed now to use the new `request::focus` signal instead. This basically reverts 20cdb5d (#152), but allows for customizing this behavior, by overriding the default `request::focus` handler (`ewmh.focus`). It would be nice if there was a helper to check if a window's content isn't visible at all (i.e. covered by other windows), and that could be used then by the (new) default handler for request::focus - raising the client only, if it's completely covered by another window. Fixes https://github.com/awesomeWM/awesome/issues/217 --- lib/awful/autofocus.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/autofocus.lua b/lib/awful/autofocus.lua index 325acb36..2f0c89f8 100644 --- a/lib/awful/autofocus.lua +++ b/lib/awful/autofocus.lua @@ -24,7 +24,7 @@ local function check_focus(obj) if not client.focus or not client.focus:isvisible() then local c = aclient.focus.history.get(obj.screen, 0, aclient.focus.filter) if c then - c:emit_signal('request::activate', "autofocus.check_focus") + c:emit_signal("request::focus", "autofocus.check_focus") end end end @@ -45,7 +45,7 @@ local function check_focus_tag(t) if client.focus and client.focus.screen ~= s then local c = aclient.focus.history.get(s, 0, aclient.focus.filter) if c then - c:emit_signal('request::activate', "autofocus.check_focus_tag") + c:emit_signal("request::focus", "autofocus.check_focus_tag") end end end