Skip to content

Gestures overhaul, part 4

Alice Mikhaylenko requested to merge wip/exalm/gestures into master

Since the MR was split into !821 (merged), !825 (merged), !826 (merged) and this, new description:

Part 4 splits workspace animation out of windowManager.js, refactors it a bit and improves multi-monitor support.

Fixes #1213 (closed)

This branch:

  • Implements a new swipe gesture tracker based on the logic I did for WebKit back/forward gesture. It supports:
    • Four-finger swipe on touchpad (based on WindowManager.TouchpadWorkspaceSwitchAction)
    • Four-finger swipe on touchscreen (based on WindowManager.WorkspaceSwitchAction)
    • Dragging (same as four-finger swipe really, but with one finger) (optionally)
    • Scrolling on touchpads (other devices tbd) (optionally)
  • Uses the swipe tracker for workspace switch gesture (#516 (closed))
  • Uses the swipe tracker for overview workspace swiping, scrolling (on touchpad) and dragging. (#516 (closed))
    • This means touchpad scrolling now follows fingers (#1338 (closed))
    • Makes workspace indicator on the right follow fingers too
    • Drag distance is now correct on any screen.
  • Uses the swipe tracker for app grid in overview. In particular, this means four-finger gestures now work (#516 (closed))
    • Touchpad scrolling follows fingers too
  • Doesn't allow scrolling workspaces or app grid with mouse while scroll animation is going. This prevents it from scrolling too fast (#1338 (closed))

In general all swipes should feel a lot more natural than before, and matching WebKit behavior (except one small tweak: swiping back very slightly when progress is > 0.5 does not cancel the gesture to make it easier to perform 4-finger touch gesture, will need to sync that back to webkit too)

The swipe gesture does not allow to switch more than one page at once. (#756 (closed))

All gestures perform their action (switch workspace/page) after the gesture animation ends instead of as soon as one lifts the fingers/stops dragging. This ensures there's no visible lag in the middle of the animation.

This also means that workspace indicator in overview moves with an animation after the gesture ends, so I made it follow fingers instead. It was very laggy, and I discovered that every indicator movement causes the whole ThumbnailBox to relayout. So instead the animation is now translation-based. (There are still a couple bugs with that)

(Reverted to relayouts now)

The other part of this is fixing workspace gesture visuals. Currently the branch:

  • Cleans up the animation a bit, by splitting it from WindowManager into its own class/file, and then refactoring it a bit more (see the commits)
  • Removes gaps when there are multiple screens with different height. Each screen with workspaces has its own animation, and the animation progress should always be synced, so that windows move with a different speed depending on the screen height, but there are no gaps and time/progress is always the same. I.e. if you drag the workspace 50% on one screen, it will be 50% on all screens regardless of height. The distance is calculated based on the "current" screen, so it should always perfectly follow fingers on touchscreen, and on touchpad swiping distance is always same regardless of screen resolution.
  • Clips animation for each screen to that screen (#1213 (closed))

Still tbd:

  • Properly separate and name commits
  • Figure out something for scrolling on non-touchpad devices. UPDATE: @snwh said the swipe-scrolling works just fine with trackpoint, so it's only mice and weird devices.
  • Do something for panel and fullscreen windows. @snwh suggested drawing fullscreen windows above panel during the animation. no consensus on what it should look like
  • Maybe look into using swipe tracker for lockscreen also? - the scope is already very large, this can be separate after swipe tracker is in. Also, the emoji picker in OSK needs the same treatment.
  • Fiх #948 (closed) (no, gitlab, don't mark it as fixed, it's not yet)
  • #948 (closed) probably also implies #945 (closed), otherwise it looks very weird

The last 2 points require a significant redesign of the spatial model, better to leave it as is right now.

The branch is currently based on !596 (closed) and requires mutter!424 (closed). It shouldn't be difficult to rebase it onto master though. That MR needs a rebase, I used this branch: Works with master mutter now, but mutter!711 (merged) is recommended.

Implements most parts of #516 (closed) (except pinch and rubber-banding)

Fixes #756, #1213, #1338

Edited by Alice Mikhaylenko

Merge request reports