Skip to content

Add Modern One-to-One Trackpad Gestures on Wayland and Xorg - #13992

Open
corbin-auriti wants to merge 2 commits into
linuxmint:masterfrom
corbin-auriti:trackpad-gestures
Open

corbin-auriti wants to merge 2 commits into
linuxmint:masterfrom
corbin-auriti:trackpad-gestures

Conversation

@corbin-auriti

Copy link
Copy Markdown
Contributor

Adds smooth "one-to-one" touchpad/touchscreen gestures that follow the fingers live and commit or cancel on release, for: switch workspace, Expo, Scale, switch windows (alt-tab), tile, maximize, minimize.
Contains @mtwebster 's native-gestures branch to allow classic one-shot gestures to work on wayland

  • Ports the swipe-tracking math from GNOME Shell (Credit: swipeTracker.js); used in both the native Wayland gesture path and the touchegg X11's
  • Extends the Gestures settings page: a picture per finger count tinted to the theme, one-click templates for 2 common setups.
  • Capability-based filtering (touchscreen vs touchpad, Wayland vs X11), and a link to it from the Mouse/Touchpad settings page.
  • Can swipe between workspaces in Scale view
  • Lots of attention to detail and polish in annimation feel/look and timing as I love and rely on this feature.
  • Disabling the touchpad now actually stops gestures on X11 (touchegg reads the touchpad through its own libinput handle, so it kept recognizing gestures even with the touchpad off).

Architecture Overview

gesturesManager.js -> nativeGestureSource.js (Wayland) OR toucheggGestureSource.js (X11) -> actions.js -> tracking.js -> drives actual actions like: tiling, Scale/Expo, window-switcher, maximize/minimize scale, workspace switching


image image

mtwebster and others added 2 commits September 12, 2026 17:44
Refactor GesturesManager to support both touchegg (X11) and native
clutter/libinput events (Wayland), since muffin's event handling
differs enough between session types that touchegg is still needed
for X11 for now. Gesture action behavior is otherwise unchanged.

Follow-up fixes folded in: connect to screensaverController directly
instead of a proxy, consolidate onto js/misc/mprisPlayer and drop
mprisController.js, a few misc fixes, and halt event propagation when
a gesture is cancelled.

ref: linuxmint/wayland#99
Add tracked gestures. A tracked gesture follows the fingers. It
updates as the fingers move. It commits or cancels when the fingers
lift. Use tracked gestures for these actions: switch workspace, show
Expo, show Scale, switch windows, tile a window, maximize a window,
and minimize a window.

Port the swipe-tracking math from GNOME Shell. Use this port for the
native gesture path on Wayland. Use the same port for the touchegg
gesture path on X11.

Extend the Gestures settings page. Add a picture for each finger
count. Tint each picture to match the theme. Add one-click templates
for common setups; each also clears the gestures it does not use.
List gesture rows up, down, left, then right. Filter the shown
gestures by what the hardware and the session support. Add a link to
this page from the Touchpad page.

Fix bugs. The tile preview now shows what push_tile() will really do.
The workspace scroll in Scale no longer fights its own animation.
Resetting gestures no longer disables the feature. A template button
no longer locks out the other button; only the highlight changes, and
it follows whatever gestures are actually set. On X11, touchegg reads
the touchpad through its own libinput handle, so disabling the
touchpad did not stop gestures; GesturesManager now also checks the
touchpad's own enabled state itself.
@github-actions

Copy link
Copy Markdown

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Most findings
are advisory and do not automatically disqualify a pull request.

This check is not perfect and will not replace a normal review.


Found 2 potential issue(s):

⚠️ WARNING

⚠️ meta_disable_unredirect

js/ui/workspaceAnimation.js:350

Meta.disable_unredirect_for_display(global.display);

Meta.disable_unredirect_for_display() / Meta.enable_unredirect_for_display()
affect compositing globally and can cause visual glitches.
This should never be used in third-party code.

js/ui/workspaceAnimation.js:362

Meta.enable_unredirect_for_display(global.display);

Meta.disable_unredirect_for_display() / Meta.enable_unredirect_for_display()
affect compositing globally and can cause visual glitches.
This should never be used in third-party code.


Automated pattern check.

@corbin-auriti

Copy link
Copy Markdown
Contributor Author

Re Github Actions Bot: Warning meta_disable_unredirect

Meta.disable_unredirect_for_display(global.display) in workspaceAnimation.js:350 Forces full compositing for every window during swipe animations, so every window's texture stays live so the clones animate smoothly

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