Pointer
When Sweets moves the pointer automatically after keyboard-driven focus and workspace changes.
sweets.pointer{ ... } controls when Sweets moves the pointer automatically
after a keyboard-driven focus or workspace change, keeping the cursor and
keyboard focus together.
sweets.pointer({
follow_focus = true,
follow_focus_restore = true,
follow_workspace = true,
follow_new_window = true,
hide_when_following = false,
})| Key | Type | Default | Description |
|---|---|---|---|
follow_focus | bool | true | Move the pointer onto a window when keyboard focus moves to it |
follow_focus_restore | bool | true | Restore the pointer to its last position on the window; false always centers it |
follow_workspace | bool | true | Restore the pointer after workspace switches |
follow_new_window | bool | true | Move the pointer to newly opened windows |
hide_when_following | bool | false | Hide the cursor after an automatic move until real input |
follow_focus
With follow_focus_restore on (the default), Sweets returns the pointer to
where it last sat within that window. Each window remembers the offset recorded
when focus last left it with the pointer over it.
Windows with no remembered position, or that resized while unfocused, fall back to centering.
Set follow_focus_restore = false to always move the pointer to the window
center.
Closing the focused window uses the same timing. Sweets moves keyboard focus and the pointer to the next window as soon as close is requested — it does not wait for the closing animation.
follow_new_window
The pointer stays put for the first window on an empty workspace, where a warp would feel unnecessary. It still follows windows opening alongside existing ones.
follow_workspace
Sweets remembers where the pointer sat within the focused window when you left a workspace, and restores it on return. If the pointer was elsewhere, the window changed, or nothing is remembered, it centers on the focused window — or the output center on an empty workspace.
Disabling this only stops the cursor warp. Workspace switches still make the selected output active, so new windows open there even with the pointer on another monitor. Real pointer input moves the active output back under the cursor.
Switching to a workspace focuses the window you last used there, not always
the master. With follow_workspace on, the pointer lands on that window.
hide_when_following
Affects automatic pointer moves only. Moving the mouse, clicking, or scrolling shows the cursor again.