mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-01-08 01:37:38 +08:00
Raise originally focused client before chosen client in window switcher
This commit is contained in:
parent
28f86888aa
commit
8a4d0d2df7
1 changed files with 12 additions and 1 deletions
|
|
@ -166,13 +166,22 @@ get_num_clients = function(s)
|
|||
return minimized_clients_in_tag + #s.clients
|
||||
end
|
||||
|
||||
-- The client that was focused when the window_switcher was activated
|
||||
local window_switcher_first_client
|
||||
-- Keygrabber configuration
|
||||
-- Helper functions for keybinds
|
||||
local window_switcher_grabber
|
||||
window_switcher_hide = function()
|
||||
-- Add currently focused client to history
|
||||
if client.focus then
|
||||
awful.client.focus.history.add(client.focus)
|
||||
local window_switcher_last_client = client.focus
|
||||
awful.client.focus.history.add(window_switcher_last_client)
|
||||
-- Raise client that was focused originally
|
||||
-- Then raise last focused client
|
||||
if window_switcher_first_client then
|
||||
window_switcher_first_client:raise()
|
||||
window_switcher_last_client:raise()
|
||||
end
|
||||
end
|
||||
-- Resume recording focus history
|
||||
awful.client.focus.history.enable_tracking()
|
||||
|
|
@ -221,6 +230,8 @@ function window_switcher_show(s)
|
|||
if get_num_clients(s) == 0 then
|
||||
return
|
||||
end
|
||||
-- Store client that is focused in a variable
|
||||
window_switcher_first_client = client.focus
|
||||
|
||||
-- Stop recording focus history
|
||||
awful.client.focus.history.disable_tracking()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue