Created
March 29, 2014 09:36
-
-
Save blueyed/9851452 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ewmh = require("awful.ewmh") | |
client.disconnect_signal("request::activate", awful.ewmh.activate) | |
client.connect_signal("request::activate", function(c) | |
if not c:isvisible() then | |
-- Meant to handle opening a link from somewhere. | |
-- Causes Firefox to steal the focus on other events though! | |
-- Would need some magic flag being set via open-in-running-browser. | |
-- if c.class == "Firefox" and c.type == "normal" then | |
-- awful.client.jumpto(c) | |
-- -- awful.tag.viewonly(c:tags()[1]) | |
-- end | |
end | |
r = false | |
if c:isvisible() then | |
if c.class == 'Firefox' then | |
-- Prevent Firefox from stealing focus (if a page reloads etc) | |
-- r = awful.client.floating.get(c) | |
r = c.type ~= "normal" | |
else | |
r = true | |
end | |
end | |
bdebug({c=c, | |
c_name=c.name and c.name or "no name", | |
isvisible=c:isvisible(), | |
transient_for=c.transient_for, | |
floating=awful.client.floating.get(c), | |
RETURN=r | |
}, "request::activate") | |
if r then | |
client.focus = c | |
c:raise() | |
else | |
if not awesome.startup then | |
c.urgent = true | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment