Add support for activating screenedges through touch swipe gestures
ClosedPublic

Authored by graesslin on Mar 19 2017, 12:46 PM.

Details

Summary

Each Edge creates a SwipeGesture for touch activation. The swipe needs to
be a single finger starting from the edge into the screen for at least
20 %. The SwipeGesture and GestureRecognizer is extended to support the
use cases of the touch screen edge swipe.

New features supported by the gesture system are:

  • minimum and maximum position
  • a minimum delta for the swipe
  • progress signal based on the minimum delta
  • starting a swipe with a start point

The Edge has the progress signal connected to its approach signal, thus
visual feedback is provided through the screen edge effect.

The screen edge system supports touch only for the edges (corners are
too difficult to activate on touch screens). At the moment the following
features are supported:

  • screen edge show/raise of windows (e.g. auto hidden panels)
  • trigger the configured action
  • trigger the configured callback function (e.g. script)

In future it might make sense to add a touch specific configuration
action to support different actions for screen edges activated by mouse
and touch.

BUG: 370323

Test Plan

configured a screen edge and triggered through touch,
added an auto-hiding panel and triggered through touch

Diff Detail

Branch
screenedge-touch
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin created this revision.Mar 19 2017, 12:46 PM
Restricted Application added a project: Plasma on Wayland. · View Herald TranscriptMar 19 2017, 12:46 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

mostly looks fine. Only one major comment about the return after handling client edges.

gestures.cpp
61

having negatives in minimumDelta would make no sense in the first place..

screenedge.cpp
76

who owns SwipeGesture?

84

equivalent ::handle() code returns after this.

92

maybe we want to do this inside the triggered lambda above, otherwise we call stopApproaching, before handling the trigger which is queued.

If our wayland side ever gets a doStopApproaching, it might result in being a bit out of order

474

Note that the only subclass of Edge doesn't call the super class for any of the virtual methods: doGeom/activate/deactivate.

To fit the current pattern this should be in setGeometry / reserve / unreserve respectively

(and yes, I know the current only subclass of Edge isn't relevant in this case)

graesslin added inline comments.Mar 19 2017, 5:41 PM
screenedge.cpp
76

good catch, that should be new SwipeGesture(this)

graesslin marked 4 inline comments as done.Mar 19 2017, 5:48 PM
graesslin added inline comments.
screenedge.cpp
474

Not sure about this one. I thought of just calling the parent method when adding it on X11. Also long term I want to get rid of the WindowBasedEdge and just use XInput2.

graesslin updated this revision to Diff 12618.Mar 19 2017, 5:48 PM

Adressed David's comments

graesslin updated this revision to Diff 12653.Mar 20 2017, 4:45 PM

Change to doFoo pattern as noted by David

davidedmundson accepted this revision.Mar 23 2017, 1:40 AM
This revision is now accepted and ready to land.Mar 23 2017, 1:40 AM
This revision was automatically updated to reflect the committed changes.