Skip to content

Add configurable trackpad gestures for the window under the pointer - #1905

Draft
kiteretsu903 wants to merge 2 commits into
rxhanson:mainfrom
kiteretsu903:fix/review-trackpad-gestures
Draft

kiteretsu903 wants to merge 2 commits into
rxhanson:mainfrom
kiteretsu903:fix/review-trackpad-gestures

Conversation

@kiteretsu903

@kiteretsu903 kiteretsu903 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds an off-by-default gesture input option with three- or four-finger swipes, adjustable sensitivity, and an action for each direction. Default mappings are left/right half, up to maximize, and down to minimize; individual directions can be disabled.

Behavior and boundaries

  • The gesture targets the window under the pointer. Target preparation is bounded and pending actions are invalidated when their target or gesture session becomes stale.
  • The initial finger-count choice considers macOS gesture conflicts. If the selected count conflicts with macOS, Rectangle pauses capture and explains the conflict; it does not change the user's system gesture settings.
  • Each contact must participate in coordinated movement. Resting contacts and combined shape outliers reject the session; contact-ID changes reset motion tracking.
  • Ordinary two-finger scrolling remains available. Once scrolling reaches the app, the same contact session cannot take it over. If capture fails, scrolling is released and actions are blocked until every contact lifts.
  • Turning the feature off stops capture. Multi-window and Todo actions are excluded because they do not operate on the single window under the pointer.

Implementation

Capture, recognition, target selection, and settings are grouped by responsibility. Recognized gestures dispatch through existing Rectangle actions rather than implementing another placement path. Layout Helper and divider code are not part of this change.

The multitouch integration uses a dynamically loaded private macOS API, loaded only while the feature is enabled. Unavailable input support must leave the feature inactive without preventing Rectangle from launching. This platform dependency is a review consideration beyond the recognizer logic.

Validation

All 618 XCTest tests pass, including regressions for resting contacts, contact-ID changes, recent velocity, scroll ownership, normal lift, and queued-action cancellation.

Native E2E verified scrolling and window actions through the real event tap and Accessibility paths. Physical three-finger swipes completed left-half, right-half, maximize, and minimize actions; two-finger scrolling with a resting palm continued without moving the window. Automated native replay also covered both finger counts.

This replaces the corresponding part of #1888.

Demo (the gesture pop-up is not part of rectangle but only in video)

08-trackpad-gestures.mp4

Window animation is disabled. Recorded with the combined build and only this feature and its required visual options enabled.

Settings

Add configurable trackpad gestures for the window under the pointer settings

@kiteretsu903
kiteretsu903 force-pushed the fix/review-trackpad-gestures branch 2 times, most recently from 958b019 to a97877a Compare October 10, 2026 02:51
@kiteretsu903
kiteretsu903 force-pushed the fix/review-trackpad-gestures branch from a97877a to b743aac Compare October 14, 2026 01:31
@rxhanson

Copy link
Copy Markdown
Owner

Sorry it took me so long to provide feedback on this one. It's mainly because I've been kind of unsure if I'm on board with rolling this in. Trackpad gestures come with some amount of baggage and maintenance, and for this reason I purposely avoided adding them into Rectangle at the start.

The Multitouch framework comes in contact with some parts of macOS that can trip and stop working unexpectedly. It's difficult to make a robust implementation that doesn't get affected by other apps and survives macOS updates. This is at odds with my philosophy for Rectangle of being a stable utility that just works out of the box, regardless of macOS settings and other apps that are running. In my other apps, Multitouch and Rectangle Pro, I've loosened this philosophy because there's more of a notion of doing more things but accepting the complexity that can come with it (and me accepting the maintenance burden for those apps).

With that said, I like the simplicity of what you've added. If it makes sense to go down the path of rolling this in, there are a few things to iron out with the current implementation, but I'll hold off on making you make changes until I'm certain it should go in.

@kiteretsu903

Copy link
Copy Markdown
Contributor Author

Sorry it took me so long to provide feedback on this one. It's mainly because I've been kind of unsure if I'm on board with rolling this in. Trackpad gestures come with some amount of baggage and maintenance, and for this reason I purposely avoided adding them into Rectangle at the start.

The Multitouch framework comes in contact with some parts of macOS that can trip and stop working unexpectedly. It's difficult to make a robust implementation that doesn't get affected by other apps and survives macOS updates. This is at odds with my philosophy for Rectangle of being a stable utility that just works out of the box, regardless of macOS settings and other apps that are running. In my other apps, Multitouch and Rectangle Pro, I've loosened this philosophy because there's more of a notion of doing more things but accepting the complexity that can come with it (and me accepting the maintenance burden for those apps).

With that said, I like the simplicity of what you've added. If it makes sense to go down the path of rolling this in, there are a few things to iron out with the current implementation, but I'll hold off on making you make changes until I'm certain it should go in.

thanks for the thoughtful feedback, and no worries about the timing! Also I really appreciate your positive comments on the simplicity of the UX.
I’d welcome your further thoughts and guidance, and am happy to work through the implementation details if you decide this is a good fit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants