Merge pull request #118 from blueyed/fix-proper-activate-via-rules
Properly fix activating an "invisible" client via rules
This commit is contained in:
commit
6183d8587a
|
@ -545,10 +545,6 @@ main(int argc, char **argv)
|
||||||
g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll);
|
g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll);
|
||||||
gettimeofday(&last_wakeup, NULL);
|
gettimeofday(&last_wakeup, NULL);
|
||||||
|
|
||||||
/* Do all deferred work now once outside of the loop to get awesome.startup
|
|
||||||
* right. */
|
|
||||||
awesome_refresh();
|
|
||||||
|
|
||||||
/* main event loop */
|
/* main event loop */
|
||||||
globalconf.loop = g_main_loop_new(NULL, FALSE);
|
globalconf.loop = g_main_loop_new(NULL, FALSE);
|
||||||
g_main_loop_run(globalconf.loop);
|
g_main_loop_run(globalconf.loop);
|
||||||
|
|
|
@ -12,7 +12,6 @@ local ipairs = ipairs
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local aclient = require("awful.client")
|
local aclient = require("awful.client")
|
||||||
local atag = require("awful.tag")
|
local atag = require("awful.tag")
|
||||||
local timer = require("gears.timer")
|
|
||||||
|
|
||||||
--- Apply rules to clients at startup.
|
--- Apply rules to clients at startup.
|
||||||
-- awful.rules
|
-- awful.rules
|
||||||
|
@ -235,11 +234,8 @@ function rules.execute(c, props, callbacks)
|
||||||
-- Do this at last so we do not erase things done by the focus
|
-- Do this at last so we do not erase things done by the focus
|
||||||
-- signal.
|
-- signal.
|
||||||
if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then
|
if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then
|
||||||
local cb = function(c)
|
|
||||||
c:emit_signal('request::activate',"rules")
|
c:emit_signal('request::activate',"rules")
|
||||||
end
|
end
|
||||||
timer.delayed_call(cb, c)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
client.connect_signal("manage", rules.apply)
|
client.connect_signal("manage", rules.apply)
|
||||||
|
|
|
@ -632,9 +632,7 @@ capi.client.connect_signal("manage", function(c)
|
||||||
c:connect_signal("property::screen", tag.withcurrent)
|
c:connect_signal("property::screen", tag.withcurrent)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
capi.client.connect_signal("manage", function(c)
|
capi.client.connect_signal("manage", tag.withcurrent)
|
||||||
timer.delayed_call(tag.withcurrent, c)
|
|
||||||
end)
|
|
||||||
capi.tag.connect_signal("request::select", tag.viewonly)
|
capi.tag.connect_signal("request::select", tag.viewonly)
|
||||||
|
|
||||||
capi.tag.add_signal("property::hide")
|
capi.tag.add_signal("property::hide")
|
||||||
|
|
|
@ -301,9 +301,6 @@ client_focus_update(client_t *c)
|
||||||
{
|
{
|
||||||
lua_State *L = globalconf_get_lua_State();
|
lua_State *L = globalconf_get_lua_State();
|
||||||
|
|
||||||
if(!client_maybevisible(c))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if(globalconf.focus.client && globalconf.focus.client != c)
|
if(globalconf.focus.client && globalconf.focus.client != c)
|
||||||
{
|
{
|
||||||
/* When we are called due to a FocusIn event (=old focused client
|
/* When we are called due to a FocusIn event (=old focused client
|
||||||
|
@ -354,7 +351,7 @@ client_focus_refresh(void)
|
||||||
return;
|
return;
|
||||||
globalconf.focus.need_update = false;
|
globalconf.focus.need_update = false;
|
||||||
|
|
||||||
if(c)
|
if(c && client_maybevisible(c))
|
||||||
{
|
{
|
||||||
/* Make sure this window is unbanned and e.g. not minimized */
|
/* Make sure this window is unbanned and e.g. not minimized */
|
||||||
client_unban(c);
|
client_unban(c);
|
||||||
|
@ -1135,6 +1132,9 @@ client_unban(client_t *c)
|
||||||
client_set_minimized(L, -1, false);
|
client_set_minimized(L, -1, false);
|
||||||
client_set_hidden(L, -1, false);
|
client_set_hidden(L, -1, false);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
|
if (globalconf.focus.client == c)
|
||||||
|
globalconf.focus.need_update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue