Skip to content

window_snapping ​

Configuration reference

With Bingux installed, drag a window toward an edge or press Super+Z to choose a layout. Bingux displays the picker; Gnoblin moves and resizes the window. The picker controls below belong to Bingux. Other shells can provide their own using the integration API.

This supports resizable Wayland and X11 windows. Minimum sizes still apply; fullscreen and fixed-size windows are excluded.

Use the picker ​

ActionResult
Drag toward the top centreShow layouts
Release at the top edgeFill the work area
Drag to a side or cornerHalf or quarter screen
Release over a layout regionSnap to that region
Hold Ctrl while draggingSelect regions in the active layout
Super+ZChoose a region for the focused window
Arrows/Tab, then EnterSelect with the keyboard
EscapeCancel
Drag a snapped window awayRestore its original size

Bingux saves layouts in ~/.config/bingux/snapping.ini. It imports Tiling Shell layouts once when available; otherwise it supplies defaults.

Windows fill the usable part of the monitor, leaving room for panels that reserve space. See drag boundaries for overlap policy.

Shell integration ​

Use the bridge socket to supply a picker. Rectangles use logical desktop pixels. Read the work area from Gnoblin; it excludes space reserved by panels. hit is where pointer release selects a region, while target is the final window rectangle.

StepMessageWhat Gnoblin returns or does
Watch drags{"op":"window-drag"}window-drag events with active, serial, window, pointer x/y, modifiers, monitor and area
Offer regionssnap-offerTests the pointer against hit rectangles on release, then applies the matching target
Ask about focus{"op":"snap-context"}snap-context with focused window, monitor and area
Apply keyboard choicesnap-windowMoves and resizes the chosen window

For example, after receiving an active drag with serial: 7, a shell can offer the left half of a 1920 × 1048 work area starting at (0, 32):

json
{
    "op": "snap-offer",
    "serial": 7,
    "regions": [
        {
            "hit": { "x": 0, "y": 32, "width": 80, "height": 1048 },
            "target": { "x": 0, "y": 32, "width": 960, "height": 1048 },
            "layout": "left-half"
        }
    ]
}

Build both rectangles from the current event's area and monitor; the numbers above show only the message shape.

An offer can contain up to 128 regions. Each hit and target rectangle contains finite logical-pixel coordinates:

FieldAccepted valuesMeaning
x, y−100,000–100,000Finite top-left position in desktop logical pixels.
width, height1–32768Rectangle size in logical pixels.
layoutOptional valueEchoed in snap-completed; Gnoblin does not interpret it.
controlBoolean, optionalRequire Ctrl to be held at pointer release.
maximizeBoolean, optionalMaximize instead of applying the target rectangle.

Set maximize: true to maximize the window instead of applying target as its final size. On success, the owner receives {"event":"snap-completed","layout":"left-half"}.

For a keyboard picker, request snap-context, let the user choose a rectangle inside its area, then send:

json
{ "op": "snap-window", "window": "42", "monitor": 0, "target": { "x": 0, "y": 32, "width": 960, "height": 1048 } }

Use the returned window and monitor IDs. Only one client can own a drag, and Gnoblin rejects stale serials or targets outside the work area.

Escape, disconnect or drag completion clears the offers. The picker does not grab input while the drag is in progress.