Fix focus workaround

This commit is contained in:
Thomas Avé 2023-05-26 15:05:03 +02:00
parent 98ad31630c
commit 60e73ee390
2 changed files with 31 additions and 10 deletions

View File

@ -24,6 +24,37 @@ local modkey = "Mod4"
-- define module table
local keys = {}
-- AwesomeWM Vim Tmux Navigator
local focus_bydirection = function(direction)
awful.client.focus.global_bydirection(direction)
if client.focus then
-- focus on the client
client.focus:raise()
end
-- BUG: focus across screens is wonky when there are no clients on the destination screen
-- https://github.com/awesomeWM/awesome/issues/3638
-- Workaround: manually unfocus client after moving focus to an empty screen
local is_empty_destination = #awful.screen.focused().clients < 1
if is_empty_destination then
-- manually unfocus the current focused client
client.focus = nil
end
end
require("awesomewm-vim-tmux-navigator") {
up = {"Up", "k"},
down = {"Down", "j"},
left = {"Left", "h"},
right = {"Right", "l"},
mod = "Mod4",
mod_keysym = "Super_L",
experimental = true,
focus = focus_bydirection
}
-- ===================================================================
-- Movement Functions (Called by some keybinds)

View File

@ -132,16 +132,6 @@ screen.connect_signal("property::geometry", awesome.restart)
collectgarbage("setpause", 110)
collectgarbage("setstepmul", 1000)
require("awesomewm-vim-tmux-navigator") {
up = {"Up", "k"},
down = {"Down", "j"},
left = {"Left", "h"},
right = {"Right", "l"},
mod = "Mod4",
mod_keysym = "Super_L",
experimental = true
}
local function move_mouse_onto_focused_client()
local c = client.focus
if c then