Add support for screenedge touchscreen events through XInput 2.2
ClosedPublic

Authored by graesslin on Mar 22 2017, 8:05 PM.

Details

Summary

This change extends the XInputEventFilter to also listen for all touch
events on the root window.

The touch points are passed to the new gesture recognizer in screenedges.

Please note that I'm not using X11 and have hardly tested this change in
real world. To our X11 users with touch screen support: please test!

Test Plan

Can activate and deactivate the screenedge.

Diff Detail

Branch
screenedge-touch-xinput
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin created this revision.Mar 22 2017, 8:05 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 22 2017, 8:05 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

cool

plugins/platforms/x11/standalone/xinputintegration.cpp
132

I think we want to always update m_lastTouchPositions outside of
if (e->detail == m_trackingTouchId)

otherwise if we get:

TouchBegin
TouchUpdate
TouchOwnership

we start the gesture in the wrong position

185

what's this for?

graesslin marked 2 inline comments as done.Mar 23 2017, 5:54 AM
graesslin added inline comments.
plugins/platforms/x11/standalone/xinputintegration.cpp
185

left over from previous approach.

graesslin updated this revision to Diff 12714.Mar 23 2017, 5:54 AM
graesslin marked an inline comment as done.

Addressed David's comments

plugins/platforms/x11/standalone/xinputintegration.cpp
132

Sorry that's not quite what i meant

m_lastTouchPositions now needs to use e->detail

And the gestureRecognizer stuff should still be inside the if.

graesslin updated this revision to Diff 12748.Mar 23 2017, 7:51 PM

Try two :-)

davidedmundson added inline comments.Mar 24 2017, 9:11 AM
plugins/platforms/x11/standalone/xinputintegration.cpp
132

you've reordered this now.

const auto last = m_lastTouchPositions.value(e->detail);

needs to happen before you update m_lastTouchPositions

graesslin added inline comments.Mar 24 2017, 2:47 PM
plugins/platforms/x11/standalone/xinputintegration.cpp
132

argh, it gets embarrassing

davidedmundson accepted this revision.Mar 24 2017, 3:18 PM
This revision is now accepted and ready to land.Mar 24 2017, 3:18 PM
This revision was automatically updated to reflect the committed changes.