Skip to content

Add 3-finger swipe gestures for workspace switching and overview - #90

Open
PushkarDesai-06 wants to merge 1 commit into
Unrud:masterfrom
PushkarDesai-06:three-finger-swipe
Open

PushkarDesai-06 wants to merge 1 commit into
Unrud:masterfrom
PushkarDesai-06:three-finger-swipe

Conversation

@PushkarDesai-06

Copy link
Copy Markdown

Closes #87

Implements the design spec from #87.

Changes

Gestures (webdata/app/touchpad.mjs)

  • 3-finger swipe left / right: next / previous workspace
  • 3-finger swipe up / down: Super key (toggle overview)
  • Each swipe fires once after ~50px of average finger travel. The remaining touches are ignored until all fingers are released, so lifting fingers one by one doesn't scroll.
  • 3-finger tap (middle click), 2-finger scroll and 1-finger move are unchanged.

Protocol

  • New keys KeyWorkspacePrev / KeyWorkspaceNext (ids 18 and 19), appended before KeyLimit so existing ids don't change. No new command.

Backends

Backend Prev / Next
X11, portal, uinput Super+Page_Up / Super+Page_Down
Windows Ctrl+Win+Left / Ctrl+Win+Right
macOS Ctrl+Left / Ctrl+Right
  • KeyToKeysyms returns the keysyms of a key combination. X11 and portal press them in order and release them in reverse. Single keys go through the existing code paths.
  • If a press fails partway, portal releases the keys it already pressed so no modifier stays stuck.

README

  • Added a Gestures section, with a note that on Linux desktops using other shortcuts, users can bind Super+Page_Up/Down to the workspace action they want.

Testing

  • gofmt, go mod tidy, and go vet / go build / go test -race for all Linux tag sets in CI pass.
  • Gesture detection tested with a script that feeds simulated touch events into Touchpad. Covered all swipe directions, firing once per swipe, short moves being ignored, the 3-finger tap, unchanged move and scroll, and no scrolling after a swipe.
  • uinput on Hyprland (Wayland): wev shows KEY_LEFTMETA held around Page_Up/Page_Down as expected.
  • Not tested on a real Windows, macOS, X11 or GNOME (portal) session. Windows and macOS builds rely on CI.

Swiping left or right with three fingers switches to the next or previous
workspace, swiping up or down sends the Super key to toggle the overview.
Each swipe fires once and the remaining touches are ignored until all
fingers are released.

Workspaces are switched with Super+Page_Up/Page_Down on Linux,
Ctrl+Win+Left/Right on Windows and Ctrl+Left/Right on macOS.

Closes Unrud#87
Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

This branch has not been deployed

No deployments
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.

Add 3-finger swipe gestures for GNOME workspace switching / overview

2 participants