tyrannical/extra/request.lua

40 lines
1.3 KiB
Lua
Raw Normal View History

2014-03-30 07:21:24 +02:00
local capi = {client=client,awesome=awesome}
local ewmh = require("awful.ewmh")
local tyrannical = nil
-- Use Tyrannical policies instead of the default ones
capi.client.disconnect_signal("request::activate",ewmh.activate)
capi.client.connect_signal("request::activate",function(c,reason)
2014-03-30 07:21:24 +02:00
if not tyrannical then
tyrannical = require("tyrannical")
end
-- Always grant those request as it probably mean that it is a modal dialog
if c.transient_for and capi.client.focus == c.transient_for then
capi.client.focus = c
c:raise()
-- If it is not modal, then use the normal code path
elseif reason == "rule" or reason == "ewmh" then
tyrannical.focus_client(c)
-- Tyrannical doesn't have enough information, grant the request
else
capi.client.focus = c
c:raise()
end
2014-03-30 07:21:24 +02:00
end)
capi.client.disconnect_signal("request::tag", ewmh.tag)
capi.client.connect_signal("request::tag", function(c)
if capi.awesome.startup then
--TODO create a tag on that screen
else
--TODO block invalid requests, let Tyrannical do its job
local tags = c:tags()
if #tags == 0 then
--TODO cannot happen
end
end
end)
--lib/awful/tag.lua.in:capi.tag.connect_signal("request::select", tag.viewonly)