diff options
author | Peter Palfrader <peter@palfrader.org> | 2019-09-03 10:15:13 +0200 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2019-09-03 10:15:13 +0200 |
commit | b02ebf7d67a9925bbd522265eda61030f2d8b4e9 (patch) | |
tree | cf2cb4ed6d2ba56e457742cab6dd1bbbb6aae709 | |
parent | ca8fb2361223bea52b91572de18848f984889232 (diff) |
Switch the "focus client under mouse after switching tags" function to a delayed_call timer
-rw-r--r-- | config/awesome/rc.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index a34984e..a88c49e 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -3,6 +3,7 @@ local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") require("awful.autofocus") +local gears = require("gears") -- Widget and layout library local wibox = require("wibox") -- Theme handling library @@ -694,6 +695,9 @@ end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- focus the client under the mouse after changing to a new tag, unless we're bringing +-- a focused client with us in viewidx_no_wrap() +-- -- from/inspired by https://stackoverflow.com/a/30684548 do_not_reset_focus = false tag.connect_signal( @@ -702,16 +706,12 @@ tag.connect_signal( local selected = tostring(t.selected) == "false" if selected then if not do_not_reset_focus then - local focus_timer = timer({ timeout = 0.05 }) - focus_timer:connect_signal("timeout", function() + gears.timer.delayed_call( function() local c = awful.mouse.client_under_pointer() if not (c == nil) then client.focus = c - -- c:raise() end - focus_timer:stop() end) - focus_timer:start() end do_not_reset_focus = false end |