Add mouse window controls and finer display scaling (#63)

Add configurable mouse and wheel bindings, window move and resize, tab drops, cross-output dragging, and device settings. Adjust display scaling in 0.05 increments.

Preserve opposite-edge positioning during scrolling resizes and show rows for edge drops into tabbed columns.
This commit is contained in:
Samuel Onoja authored and GitHub committed 2026-10-25 14:14:35 +01:00
1 parent ab11269246
commit ad00e55fe4
35 files changed
+3454 -512

No files matched your search

+6 -2
View File
@@ -117,19 +117,23 @@ Super+BackSpace last focused window; Alt+Tab/Alt+Shift+Tab MRU switching;
Super+Shift+S area screenshot; Print Screen whole-screen screenshot;
Super+Shift+E logout confirmation.
Hold Super and drag a floating window with the left mouse button to move it.
Hold Super and drag a floating or tiled window with the left mouse button to move it.
Hold Super and drag with the right mouse button to resize. The starting position
selects an edge or corner using a 3×3 grid; the center selects the nearest corner.
The selected edges stay fixed for the whole drag. These work even when an app has
no title bar or resize border.
Tiled drops can reorder windows, join tab groups or move between monitors.
Mouse buttons and wheel directions can also use the regular binding actions;
see [mouse bindings](input.md#mouse-bindings) for configuration and drag controls.
For a floating window, Super+Shift+H/J/K/L moves left/down/up/right by 32 logical
pixels. Super+Ctrl+H/L shrinks/grows its width; Super+Ctrl+K/J shrinks/grows its
height by the same step. Keyboard adjustments respect client size limits and
keep the window reachable in its output's work area. Fullscreen and maximized
floating windows ignore these actions.
Mouse moves and resizes snap to work-area edges and nearby visible window edges at
Floating moves and resizes snap to work-area edges and nearby visible window edges at
10 logical pixels, then resist movement until 20 pixels from the attached edge.
Window edges are eligible only when the windows overlap along the other axis,
with a 10-pixel allowance. Hold Shift during a drag to bypass snapping.
+72 -3
View File
@@ -19,9 +19,43 @@ focus keys move the selection, Enter activates it, and Escape dismisses Overview
Clicking a workspace card's background switches workspaces while keeping Overview
open. Previews follow layout order and use the configured shell font and colors.
The touchpad device keys are booleans, all defaulting to `true`: `tap`,
`natural-scroll` and `disable-while-typing`. These apply to DRM devices; nested
previews use the host's physical input settings.
The touchpad keys `tap`, `natural-scroll` and `disable-while-typing` default to
`true`. Set `disable-while-mouse-connected #true` to pause a built-in touchpad
while an external mouse is connected. It defaults to `false` and uses libinput's
external-mouse policy on supported touchpads, including when a mouse is plugged
in or removed during the session. The toggle is also in **Settings → Keyboard & mouse**.
These device settings apply to DRM sessions; nested previews use the host's
physical input settings.
Touchpad `accel-speed` is independent of the mouse setting. It accepts −1.0 to
1.0 and defaults to 0.0. Both speed controls are available in Settings and reload
immediately in a hardware session.
```kdl
input {
touchpad {
accel-speed 0.0
disable-while-mouse-connected #true
}
mouse {
natural-scroll #false
accel-speed 0.0
// accel-profile "flat"
left-handed #false
middle-emulation #false
scroll-factor 1.0
drag-threshold 4.0
scroll-cooldown-ms 150
}
}
```
Mouse settings are separate from touchpad settings and reload live. `accel-speed`
accepts -1.0 to 1.0; `accel-profile` accepts `adaptive` or `flat`, and follows the
device default when omitted. `scroll-factor` scales application wheel scrolling
(0.01–100). `drag-threshold` is the distance before a window drag starts (0–100
logical pixels). `scroll-cooldown-ms` limits repeated wheel bindings (0–5000 ms);
zero allows each accumulated tick to run its action.
Workspace swipes and left/right window-focus swipes follow your fingers and settle
when released. Up goes to the next workspace on the
@@ -51,3 +85,38 @@ hardware session.
Adjust recognition distance in **Settings → Keyboard & mouse**, or with
`swipe-threshold 80` under `input.touchpad` (integer 16–1000 logical pixels).
## Mouse bindings
`Super+MouseLeft` drags a window and `Super+MouseRight` resizes it. Both work with
floating windows and tiled windows in scrolling or tree layouts. Drag a tiled
window to another window's edge to place it beside that window, or to its center
to join a tab group. Top and bottom drops into a tabbed column show its windows as
rows. Drag across monitors to move to the workspace shown there.
While dragging, right-click to switch between floating and tiling. Scroll or hold
the pointer at a horizontal screen edge to reach other scrolling columns.
Escape cancels the operation; releasing the initiating button finishes it.
Fullscreen windows keep their current layout until you leave fullscreen.
Mouse bindings use the same actions, overrides and named binding modes as keyboard
bindings. Ordinary actions use the current keyboard focus; `pointer-move` and
`pointer-resize` operate on the window under the pointer. Client popup grabs,
pointer constraints, shortcut inhibition and session locking take precedence.
```kdl
binding "Alt+MouseLeft" action="pointer-move"
binding "Alt+MouseRight" action="pointer-resize"
binding "Super+MouseLeft" disabled=#true
binding "Super+WheelUp" action="workspace-previous"
binding "Super+WheelDown" action="workspace-next"
binding "Super+TouchpadScrollLeft" action="focus" argument="left"
binding "Super+MouseBack" action="focus-last-window"
```
Buttons include `MouseLeft`, `MouseRight`, `MouseMiddle`, `MouseBack` and
`MouseForward`, or `mouse:272` through `mouse:287` for Linux mouse button codes.
Wheel directions are `WheelUp`, `WheelDown`, `WheelLeft` and `WheelRight`.
Touchpad scroll bindings use the `TouchpadScroll` prefix with the same directions.
Only a bound scroll axis is intercepted; the other axis still reaches the client.
High-resolution wheel steps accumulate into ticks. An intercepted touchpad scroll
keeps its event ownership until the gesture stops, even if modifiers change.