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

Introduce a pan backend for touchscreen gestures #2096

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Oct 16, 2024

This allows exact finger tracking for touchscreen devices. Fixes #1272

Fixes #1801

In the long term with some coming mutter changes it will handle all gestures (touchpad as well) in order to remove the need of touchegg which currently only works because of xwayland.

This will also allow us to have much more precise gestures: e.g. swipe up from the bottom to reveal the dock one to one will be trivial to implement (PR incoming). It can also be used to do swipe in from corners to use hotcorners on touchscreen (another PR incoming :) ).

TODO:

  • Cleanup commits
  • Fix meta_wayland_pointer_set_focus: assertion 'meta_cursor_tracker_get_pointer_visible (cursor_tracker) || clutter_seat_is_unfocus_inhibited (clutter_seat) || surface == NULL' failed

For easier review see the individual commits and also their message for details about some changes.
Rebase merge

@leolost2605 leolost2605 marked this pull request as draft October 16, 2024 23:54
@leolost2605 leolost2605 force-pushed the leolost/use-gesture-pan-backend branch 2 times, most recently from 3ea71e2 to 9721f90 Compare October 18, 2024 15:49
The grab should always be on the actor that was last pushed modal.
Clutter keeps a stack of grabs internally so we just can grab every actor.
Add information about whether a gesture will be handled. This might be used to
determine whether events are supposed to be consumed.
Add information about the origin of a gesture. This might be used to determine
whether a gesture should be handled (e.g. only allow swipe from screen edge).
Add common GestureBackend interface that all backends have to implement.
Add a on_gesture_handled signal to the GestureTracker which runs if and only if
true was returned in on_gesture_detected. Before it is emitted prepare_gesture_handling
will be called on the backend. This will be needed for the upcoming PanBackend to avoid
conflicts in event consuming.
Add a utility get_action to the GestureSettings that gets the corresponding action for a gesture.
This allows to remove some duplicated code.
@leolost2605 leolost2605 force-pushed the leolost/use-gesture-pan-backend branch from 9721f90 to d687cf5 Compare October 18, 2024 15:51
@leolost2605 leolost2605 marked this pull request as ready for review October 18, 2024 15:52
@leolost2605 leolost2605 force-pushed the leolost/use-gesture-pan-backend branch from d687cf5 to 483f373 Compare October 18, 2024 15:54
@leolost2605
Copy link
Member Author

This should be ready for testing/review now

@leolost2605 leolost2605 force-pushed the leolost/use-gesture-pan-backend branch from 483f373 to 5455727 Compare October 18, 2024 16:55
@leolost2605 leolost2605 force-pushed the leolost/use-gesture-pan-backend branch from 5455727 to d5ffdff Compare October 18, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant