Skip to content

feat: add configurable touchpad gestures - #2838

Open
abhighansala wants to merge 1 commit into
pop-os:masterfrom
abhighansala:feature/configurable-touchpad-gestures
Open

feat: add configurable touchpad gestures#2838
abhighansala wants to merge 1 commit into
pop-os:masterfrom
abhighansala:feature/configurable-touchpad-gestures

Conversation

@abhighansala

Copy link
Copy Markdown

Configurable Touchpad Gestures

This change adds the compositor-side foundation for configurable touchpad gestures in COSMIC.

What changed

  • Added a configurable TouchpadGestures structure to cosmic-comp-config.

  • Added separate gesture configurations for 3-finger and 4-finger swipes.

  • Added configurable actions for:

    • App Library

    • Workspace Overview

    • Previous Workspace

    • Next Workspace

    • Window Switcher

    • Window Switcher Previous

    • None

  • Updated gesture handling in cosmic-comp to resolve actions from the configured finger count and swipe direction.

  • Added 3-finger gesture support:

    • Swipe Up → App Library

    • Swipe Left → Window Switcher Previous

    • Swipe Right → Window Switcher

  • Preserved the existing 4-finger workspace and Workspace Overview behavior.

  • Added App Library surface detection alongside the existing Workspace Overview detection.

  • Reused the existing COSMIC system actions for Window Switching, App Library, and Workspace Overview instead of implementing duplicate functionality.

  • Added layout-aware defaults so existing horizontal and vertical workspace behavior remains compatible.

  • Changed gesture capture so all gestures with 3 or more fingers are tracked by the compositor.

Default gesture mapping

Gesture | Default action -- | -- 3-finger Up | App Library 3-finger Down | None 3-finger Left | Window Switcher Previous 3-finger Right | Window Switcher 4-finger Up | Workspace Overview 4-finger Down | Workspace Overview 4-finger Left | Previous Workspace 4-finger Right | Next Workspace

The cosmic-settings UI for editing these mappings will be implemented separately.

Verification

The changes were verified with:

git diff --check
cargo check
cargo build --release

All checks completed successfully.

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

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.

1 participant