Pointer
When the pointer follows focus, and when focus follows the pointer
sweets.pointer decides when the cursor follows keyboard-driven focus and
workspace changes, and whether moving the cursor into a window focuses it.
sweets.pointer({
focus_follows_mouse = true,
follow_focus = true,
follow_focus_restore = true,
follow_workspace = true,
follow_new_window = true,
follow_new_window_dialogs = false,
hide_when_following = false,
})| Field | Type | Default | Description |
|---|---|---|---|
focus_follows_mouse | boolean | true | Focus a window when the pointer moves into it |
follow_focus | boolean | true | Move the pointer onto a window when keyboard focus moves to it |
follow_focus_restore | boolean | true | Return to the last position on that window; false always centers |
follow_workspace | boolean | true | Move the pointer after a workspace switch |
follow_new_window | boolean | true | Move the pointer to a newly opened window |
follow_new_window_dialogs | boolean | false | Include dialogs and transient windows in the above |
hide_when_following | boolean | false | Hide the cursor after an automatic move until you use it |
focus_follows_mouse
Set it to false for click-to-focus:
sweets.pointer({
focus_follows_mouse = false,
})Pointer entry then changes nothing and a click focuses the window. This helps with a trackball or tablet parked over the wrong window, and with applications whose hover menus reach past their own edge.
Moving onto another monitor still selects that monitor either way, so an empty monitor stays reachable without a click. Selecting a monitor does not change keyboard focus.
focus_follows_mouse and follow_focus are opposites. This one lets the
pointer choose the focused window; follow_focus moves the pointer after a
focus action.
follow_focus
With follow_focus_restore on, each window remembers where the pointer sat
when focus last left it and the cursor returns there. A window with nothing
remembered, or one that resized while unfocused, is centered instead.
Closing the focused window moves focus and the pointer to the next window immediately, without waiting for the close animation.
follow_workspace
Sweets restores the pointer to the window you were using on that workspace. If nothing is remembered it centers on the focused window, or on the monitor for an empty workspace.
Turning this off stops the warp only. A workspace switch still makes that monitor active, so new windows open there even with the cursor elsewhere. Moving the mouse makes the monitor under it active again.
Switching to a workspace focuses the window you last used there, not the master. The pointer follows that window.
follow_new_window
The pointer stays put for the first window on an empty workspace. It still follows windows that open alongside existing ones.
hide_when_following
Hides the cursor after an automatic move only. Moving the mouse, clicking, or scrolling brings it back.