Add signal for raising urgent clients when switching tags

This commit is contained in:
elenapan 2020-03-21 07:23:57 +02:00
parent a10091a0c4
commit 3e22142501
2 changed files with 15 additions and 14 deletions

View file

@ -160,10 +160,6 @@ end
-- Useful for quick switching after for example checking an incoming chat
-- message at tag 2 and coming back to your work at tag 1 with the same
-- keypress.
-- Also focuses urgent clients if they exist in the tag. This fixes the issue
-- (visual mismatch) where after switching to a tag which includes an urgent
-- client, the urgent client is unfocused but still covers all other windows
-- (even the currently focused window).
function helpers.tag_back_and_forth(tag_index)
local s = mouse.screen
local tag = s.tags[tag_index]
@ -173,19 +169,9 @@ function helpers.tag_back_and_forth(tag_index)
else
tag:view_only()
end
local urgent_clients = function (c)
return awful.rules.match(c, {urgent = true, first_tag = tag})
end
for c in awful.client.iterate(urgent_clients) do
client.focus = c
c:raise()
end
end
end
-- Resize DWIM (Do What I Mean)
-- Resize client or factor
-- Constants --

View file

@ -959,6 +959,21 @@ client.connect_signal("request::activate", function(c, context, hints)
end
end)
-- When switching to a tag with urgent clients, raise them.
-- This fixes the issue (visual mismatch) where after switching to
-- a tag which includes an urgent client, the urgent client is
-- unfocused but still covers all other windows (even the currently
-- focused window).
awful.tag.attached_connect_signal(s, "property::selected", function ()
local urgent_clients = function (c)
return awful.rules.match(c, {urgent = true, first_tag = mouse.screen.selected_tag})
end
for c in awful.client.iterate(urgent_clients) do
client.focus = c
c:raise()
end
end)
-- Focus urgent clients automatically
-- client.connect_signal("property::urgent", function(c)
-- if c.urgent then