Fix focus workaround
This commit is contained in:
		
							parent
							
								
									98ad31630c
								
							
						
					
					
						commit
						60e73ee390
					
				|  | @ -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) | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue