From 055ad392ee5dbfed0ea38b70f9c9855c884b0eb6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 14 Feb 2015 14:29:16 +0100 Subject: [PATCH 1/3] Revert "Revert "Partly revert commit 90fde1393f"" This reverts commit 1c6463822e590508d40862a47ecd86a9a0b8c776. --- lib/awful/tag.lua.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index f746ed48..cfb3b105 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -630,9 +630,7 @@ capi.client.connect_signal("manage", function(c) c:connect_signal("property::screen", tag.withcurrent) end) -capi.client.connect_signal("manage", function(c) - timer.delayed_call(tag.withcurrent, c) -end) +capi.client.connect_signal("manage", tag.withcurrent) capi.tag.connect_signal("request::select", tag.viewonly) capi.tag.add_signal("property::hide") From 76ede0ef45228535a78146f30883b13b7d741d61 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 14 Feb 2015 14:29:29 +0100 Subject: [PATCH 2/3] Revert "awful.rules.execute: use delayed_call for emitting request::activate" The 'request::activate' signal should be sent and handled immediately, and not delayed. It was too much of a hack to work around the client not being visible. Instead, the "is visible" constraint on `capi.client.focus` will be removed. This reverts commit 6963ede3dca9d45e6813b4a099ffe8f8fa2dd46e. --- awesome.c | 4 ---- lib/awful/rules.lua.in | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/awesome.c b/awesome.c index b847603c..6e0213d5 100644 --- a/awesome.c +++ b/awesome.c @@ -545,10 +545,6 @@ main(int argc, char **argv) g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll); gettimeofday(&last_wakeup, NULL); - /* Do all deferred work now once outside of the loop to get awesome.startup - * right. */ - awesome_refresh(); - /* main event loop */ globalconf.loop = g_main_loop_new(NULL, FALSE); g_main_loop_run(globalconf.loop); diff --git a/lib/awful/rules.lua.in b/lib/awful/rules.lua.in index daaf0728..e344828c 100644 --- a/lib/awful/rules.lua.in +++ b/lib/awful/rules.lua.in @@ -12,7 +12,6 @@ local ipairs = ipairs local pairs = pairs local aclient = require("awful.client") local atag = require("awful.tag") -local timer = require("gears.timer") --- Apply rules to clients at startup. -- awful.rules @@ -235,10 +234,7 @@ function rules.execute(c, props, callbacks) -- Do this at last so we do not erase things done by the focus -- signal. if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then - local cb = function(c) - c:emit_signal('request::activate', "rules") - end - timer.delayed_call(cb, c) + c:emit_signal('request::activate',"rules") end end From 2174b80c3fbb4ad6d380069dd02f7883f1258333 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 14 Feb 2015 14:09:10 +0100 Subject: [PATCH 3/3] client_focus_update: allow "invisible" clients This removes the check for `client_maybevisible`, which now allows for `client.focus = c` from Lua for clients that do not are assigned to a tag yet. --- objects/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/objects/client.c b/objects/client.c index 1e2ea4f8..f5edffae 100644 --- a/objects/client.c +++ b/objects/client.c @@ -301,9 +301,6 @@ client_focus_update(client_t *c) { lua_State *L = globalconf_get_lua_State(); - if(!client_maybevisible(c)) - return false; - if(globalconf.focus.client && globalconf.focus.client != c) { /* When we are called due to a FocusIn event (=old focused client @@ -354,7 +351,7 @@ client_focus_refresh(void) return; globalconf.focus.need_update = false; - if(c) + if(c && client_maybevisible(c)) { /* Make sure this window is unbanned and e.g. not minimized */ client_unban(c); @@ -1135,6 +1132,9 @@ client_unban(client_t *c) client_set_minimized(L, -1, false); client_set_hidden(L, -1, false); lua_pop(L, 1); + + if (globalconf.focus.client == c) + globalconf.focus.need_update = true; } }