better logic
This commit is contained in:
parent
e5029ca26e
commit
f02369507f
13
init.lua
13
init.lua
|
@ -39,22 +39,27 @@ client.connect_signal("focus", function(c)
|
||||||
local focused_client = c
|
local focused_client = c
|
||||||
--+ client the focus is going towards
|
--+ client the focus is going towards
|
||||||
|
|
||||||
gears.timer.weak_start_new(0.05, function()
|
gears.timer.weak_start_new(0.15, function()
|
||||||
local client_under_mouse = mouse.current_client
|
local client_under_mouse = mouse.current_client
|
||||||
local should_stay = set_contains(stay_classes, client_under_mouse.class)
|
local should_stay = set_contains(stay_classes, client_under_mouse.class)
|
||||||
|
|
||||||
if should_stay then return false end
|
if should_stay then return false end
|
||||||
--+ exclusions
|
--+ exclusions
|
||||||
|
|
||||||
|
-- if compare_coords(focused_client) then return false end
|
||||||
|
--+ avoid tabs
|
||||||
|
|
||||||
if not client_under_mouse then
|
if not client_under_mouse then
|
||||||
micky()
|
micky()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
--+ nothing under the mouse, move directly
|
--+ nothing under the mouse, move directly
|
||||||
|
|
||||||
if focused_client ~= client_under_mouse then
|
if focused_client:geometry().x ~= client_under_mouse:geometry().x
|
||||||
micky()
|
or focused_client:geometry().y ~= client_under_mouse:geometry().y
|
||||||
return false
|
then
|
||||||
|
micky()
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
--+ no need to relocate the mouse if already over
|
--+ no need to relocate the mouse if already over
|
||||||
--> the client.
|
--> the client.
|
||||||
|
|
Loading…
Reference in New Issue