Skip to content

Commit

Permalink
Add an option to skip moving the pointer away during cycling
Browse files Browse the repository at this point in the history
Usually cyclefocus moves the pointer to the top left corner of the
screen during cycling to avoid interference from sloppy focus handling.
However, if the user does not use sloppy focus, this pointer movement is
not needed, and can be annoying.  Add an option to disable this pointer
movement.

Signed-off-by: Sergey Vlasov <[email protected]>

Closes #36
  • Loading branch information
sigprof authored and blueyed committed May 7, 2019
1 parent e3f8742 commit 1ba83dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ cyclefocus = {
-- can use when overriding this with a function (that gets the client as
-- argument).
raise_client = true,
-- Should the mouse pointer be moved away during cycling?
-- This is normally done to avoid interference from sloppy focus handling,
-- but can be disabled if you do not use sloppy focus.
move_mouse_pointer = true,

-- How many entries should get displayed before and after the current one?
display_next_count = 3,
Expand Down
6 changes: 5 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ cyclefocus = {
-- can use when overriding this with a function (that gets the client as
-- argument).
raise_client = true,
-- Should the mouse pointer be moved away during cycling?
-- This is normally done to avoid interference from sloppy focus handling,
-- but can be disabled if you do not use sloppy focus.
move_mouse_pointer = true,

-- How many entries should get displayed before and after the current one?
display_next_count = 3,
Expand Down Expand Up @@ -890,7 +894,7 @@ cyclefocus.cycle = function(startdirection_or_args, args)

-- Move mouse pointer away to avoid sloppy focus kicking in.
local restore_mouse_coords
if show_clients then
if show_clients and args.move_mouse_pointer then
local s = capi.screen[capi.mouse.screen]
local coords = capi.mouse.coords()
restore_mouse_coords = {s = s, x = coords.x, y = coords.y}
Expand Down

0 comments on commit 1ba83dd

Please sign in to comment.