Sweets
Configuration

Mouse Bindings

Use the built-in pointer gestures to focus, move, reorder, and resize managed windows.

Sweets currently provides a small set of built-in mouse actions. Custom mouse bindings are not part of the Lua configuration API yet.

InputAction
Super + left dragMove a managed window
Super + right dragResize a managed window from the pointer's quadrant
Ordinary clickSend the button to the client and focus the clicked window
Wheel or touchpad scrollSend scrolling to the surface under the pointer

The compositor move and resize modifier is currently the Super/logo key. Changing general.mod_key changes keyboard bindings, but does not change these pointer grabs yet.

Starting a compositor grab

Press Super with the pointer over a normal managed window, then hold the left or right mouse button. Sweets focuses the window and consumes that initiating button so the application does not also handle the drag.

A compositor grab does not begin while the session is locked or another pointer grab is active. Maximized and fullscreen windows must leave that state before they can be moved or resized this way.

Moving tiled windows

A tiled window remains tiled throughout a move. While the window follows the pointer as a separate drag visual, the other tiles reflow to fill its vacated slot. Cancelling the grab restores the original order.

The drag_center_cursor general option controls the initial tiled drag anchor:

sweets.general({
    drag_center_cursor = true,
})

With the default true value, Sweets centers the dragged window under the stationary pointer as the grab begins. With false, it preserves the exact point where you grabbed the window. The centered behavior applies only to a compositor Super + left drag of a tiled window; floating moves and client-requested moves always preserve the exact grab point. Reloading the option affects the next grab, not one already in progress.

Dropping and reordering tiles

On the same workspace, a drop reorders the tiled window only after the dragged edge crosses far enough into another tile and overlaps it on the perpendicular axis. The threshold comes from layout.reorder_ratio:

sweets.layout({
    reorder_ratio = 0.3,
})

The default 0.3 requires 30% penetration into the candidate tile. Sweets uses the drag's dominant direction to choose whether the window lands before or after it. Dropping back into the original slot, into a gap, or outside a valid candidate keeps the existing order.

Layout-specific rules still apply:

  • Monocle has no visible tile order to change, so a drag does not reorder it.
  • Deck can swap the master with the visible stack boundary; hidden stack members are not arbitrary drop targets.

Dropping a tiled window over another output moves it to that output's currently visible numbered workspace. It is inserted before the tile under the pointer, or at the end when dropped over empty workspace area. The destination output becomes selected, and the window remains tiled.

Moving floating windows

A floating move always preserves the exact point where the window was grabbed. The drag_center_cursor option does not affect it.

Sweets keeps part of the window reachable within the work area while it moves. Releasing it over a different output transfers it to that output's visible workspace without changing its global drop position.

Resizing windows

For Super + right drag, the pointer's position within the window chooses the top or bottom and left or right resize edges. A corner drag can therefore change both axes.

Floating windows resize freely while respecting the client's minimum and maximum size hints. Sweets also keeps part of the window reachable in the output work area.

Tiled windows remain tiled. The drag adjusts only boundaries supported by the active layout:

LayoutAdjustable tiled boundaries
TileMaster/stack boundary and boundaries between stack windows
CenteredSymmetric master width or a boundary inside one side stack
GridRow and column boundaries; a corner can adjust both
ColumnsBoundary between adjacent columns or rows, depending on orientation
DeckMaster/stack boundary only
DwindleThe nearest recursive split; a corner can adjust both axes
MonocleNone

If the grabbed tiled edge does not own an adjustable boundary, the resize is a no-op; Sweets does not turn the window floating. See Layout for layout behavior and keyboard resize actions.

Client-requested moves and resizes

Applications can request a move or resize themselves, such as when you drag a client-side titlebar or border. Sweets accepts the request only when it belongs to the focused window and matches the active pointer press. Stale, unfocused, or cross-client requests are rejected.

Accepted client-requested operations use the same tiled or floating policy as the built-in gestures. Client-requested moves preserve the exact grab point instead of using drag_center_cursor.

Configuration and reload

There is currently no sweets.mouse_bind API and no Lua option for assigning arbitrary buttons, scroll directions, or gestures to actions. The available mouse-related behavior is configured through existing options such as general.drag_center_cursor and layout.reorder_ratio.

After editing sweets.lua, validate and reload it with:

sweets --check-config
sweets msg reload

For automatic pointer relocation and focus behavior, see Pointer. For device scrolling and acceleration, see Input Devices.

On this page