On Tue, May 26, 2009 at 03:16, koniu <[email protected]> wrote:
> There's more: we're also now lacking focus history restore when
> clients go away (unmanage, hide, minimize). I'm trying to figure out
> best way to hook this.
I've tried this but it's not working so well when hiding clients, the
hidden client somehow fails to hide at first attempt.
function restore_focus(screen)
if not client.focus or not client.focus:isvisible() then
local c = awful.client.focus.history.get(screen, 0)
if c then client.focus = c end
end
end
awful.hooks.property.register(function (c, prop)
if prop == "hide" or prop == "minimized" then
restore_focus(c.screen)
end
end)
awful.hooks.tags.register(function (screen, tag, view)
restore_focus(screen) end)
awful.hooks.unmanage.register(function (c) restore_focus(c.screen) end)
--
To unsubscribe, send mail to [email protected].