Sweets
Configuration

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, so the cursor and keyboard focus stay together.

sweets.pointer({
  follow_focus = true,
  follow_focus_restore = true,
  follow_workspace = true,
  follow_new_window = true,
  hide_when_following = false,
})
KeyTypeDefaultDescription
follow_focusbooltrueMove the pointer onto a window when keyboard focus moves to it
follow_focus_restorebooltrueWhen following focus, restore the pointer to its last position on the window; set false to always center it
follow_workspacebooltrueRestore the pointer to its last position on the focused window after workspace switches (centering on it, or the output center, as fallbacks)
follow_new_windowbooltrueMove the pointer to newly opened windows (except the first window on an empty workspace)
hide_when_followingboolfalseHide the cursor after an automatic pointer move until real pointer input

hide_when_following

Only affects automatic pointer moves that are still enabled. Moving the mouse, clicking, or scrolling shows the cursor again.

follow_focus

When keyboard focus moves to a window and follow_focus_restore is on (the default), Sweets restores the pointer to where it last sat within that window. Each window remembers the pointer offset recorded when focus last left it with the pointer over it, so returning to a window puts the cursor back near the same spot (for example its top-right corner) instead of its center. Windows that have no remembered position yet, or that resized while unfocused, fall back to centering (clamped to the window).

Set follow_focus_restore = false to keep the older behavior, where focusing a window always moves the pointer to its center.

follow_new_window

The pointer is left in place for the very first window on an empty workspace, where a warp would feel unnecessary. It still follows windows that open alongside existing ones.

follow_workspace

Disabling follow_workspace only stops the cursor warp. Keyboard-driven workspace switches still make the selected output/workspace active, so newly spawned windows open there even when the pointer remains on another monitor. Real pointer input updates the active output back to the monitor under the cursor.

Switching to a workspace focuses the window you last used there (most recently focused), not always the master. With follow_workspace on, the pointer lands on that window so the cursor and keyboard focus stay together.

Sweets remembers where the pointer sat within the focused window when you left a workspace, and restores it to that spot when you return. If the pointer was not over the focused window, the window changed, or there is no remembered position, it falls back to centering on the focused window (or the output center on an empty workspace).

On this page