Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Gesture configuration backend #396

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryanabx
Copy link
Contributor

@ryanabx ryanabx commented Apr 1, 2024

This is an implementation of a backend gesture configuration based on a gist I made a few weeks ago: https://gist.github.com/ryanabx/e18b70d58f651c1a6946a5bca7a11165

This method of configuration would allow the frontend settings to do whatever they'd like with the gesture configuration without having to do something complex (unless they wanted to!)

Basically, gesture configurations are split per finger count and can be one of two types:

  • Workspace dependent (depends on the direction of workspaces (horizontal/vertical) (for example, workspace switching gestures would need to be workspace dependent)
  • Directional (doesn't depend on the direction of workspaces) (for example, window focus switching gestures need to be workspace independent)

to-do:

  • configurable gesture implementation in the input module
  • config item for touchpad gestures
  • default configuration for touchpad gestures (I don't know how to do this, advice needed)

@ryanabx ryanabx force-pushed the input/gesture-config branch 3 times, most recently from f89023e to d42b6df Compare April 1, 2024 00:53
@ryanabx ryanabx force-pushed the input/gesture-config branch from d42b6df to 0eccd82 Compare April 15, 2024 03:23
@ryanabx ryanabx changed the title draft: gesture configuration backend feat: Gesture configuration backend Apr 15, 2024
@ryanabx ryanabx marked this pull request as ready for review April 15, 2024 03:25
@ryanabx ryanabx force-pushed the input/gesture-config branch from 0eccd82 to 38898bf Compare April 16, 2024 20:46
@ryanabx
Copy link
Contributor Author

ryanabx commented Apr 16, 2024

Rebased to include the RWLock changes. @Drakulix can you look at this at some point? I think this is a good direction to go for gesture configurations but I need to know if you and others agree

WindowLeft,
WindowRight,
Custom(String),
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need another enum for this? We already have the Action-enum that is used for key-bindings. Can't we just use that and special case some actions like NextWorkspace/PreviousWorkspace when using gestures? (To animate those properly.)

That would make configuration much more flexible and allow binding more things to gestures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll look into doing that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After looking into it, I'll hold onto this PR until #400 is finished, because it moves the Actions enum into cosmic-comp-config, where I need it

@ryanabx ryanabx force-pushed the input/gesture-config branch from 38898bf to 9319fe3 Compare April 20, 2024 04:44
@ryanabx ryanabx marked this pull request as draft December 17, 2024 19:09
@ryanabx
Copy link
Contributor Author

ryanabx commented Dec 18, 2024

Going to start working on this again. But it looks like actions and keybinds are defined in c-s-d, so I'm going to make the proper gesture type there first!

ryanabx added a commit to ryanabx-contrib/cosmic-settings-daemon that referenced this pull request Dec 20, 2024
This commit adds a Gesture abstraction, which can define gestures by the
number of fingers used, and the direction the gesture is performed in.

Oftentimes, we want the gesture to be either absolute (i.e. ignoring
context such as workspace direction), or relative (if workspaces
are horizontal, forward would be right, backward would be left. if
workspaces are vertical, forward would be up, backward would be down).

The abstraction is modeled after the Binding type, and the resulting
Gestures type is similar to the Shortcuts type.

This is the first step in implementing configurable touchpad gestures
(pop-os/cosmic-comp#396)

Signed-off-by: Ryan Brue <[email protected]>
ryanabx added a commit to ryanabx-contrib/cosmic-settings-daemon that referenced this pull request Dec 20, 2024
This commit adds a Gesture abstraction, which can define gestures by the
number of fingers used, and the direction the gesture is performed in.

Oftentimes, we want the gesture to be either absolute (i.e. ignoring
context such as workspace direction), or relative (if workspaces
are horizontal, forward would be right, backward would be left. if
workspaces are vertical, forward would be up, backward would be down).

The abstraction is modeled after the Binding type, and the resulting
Gestures type is similar to the Shortcuts type.

This is the first step in implementing configurable touchpad gestures
(pop-os/cosmic-comp#396)

Signed-off-by: Ryan Brue <[email protected]>
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