[libinput] Send touch events with respect to device rotation
ClosedPublic

Authored by romangg on Dec 12 2019, 2:43 PM.

Details

Summary

Touch events coming from libinput devices must be transformed according to the
current device rotation.

BUG: 417325

Test Plan

Manually.

Diff Detail

Repository
R108 KWin
Branch
touch-rotation-fix
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 19751
Build 19769: arc lint + arc unit
romangg created this revision.Dec 12 2019, 2:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptDec 12 2019, 2:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Dec 12 2019, 2:43 PM
romangg updated this revision to Diff 71361.Dec 12 2019, 2:44 PM

Empty line removed

romangg updated this revision to Diff 71376.Dec 12 2019, 4:30 PM

Rebase on series changes.

zzag accepted this revision.Dec 13 2019, 9:16 AM
zzag added a subscriber: zzag.
zzag added inline comments.
libinput/connection.cpp
254

Can be static.

259

Yeah, I think so.

This revision is now accepted and ready to land.Dec 13 2019, 9:16 AM
apol added a subscriber: apol.Dec 18 2019, 12:20 AM

Just tested it, works okay.

Now the pen is broken. 😅

FWIW, I'm fine with this set merged and fixing as we go.

In D25921#579478, @apol wrote:

Just tested it, works okay.

Now the pen is broken. 😅

Oh right. But before you put any time into trying to fix it. I think I found a generic fix: There is a function in our libinput code setting the device input matrix dependent on rotation but I accidentally "deactivated" it some time ago when moving around code in the Screens class. I would look into that soon and then might revert the patch here as well (in case setting the matrix also fixes the touch events).

FWIW, I'm fine with this set merged and fixing as we go.

apol added a comment.Dec 18 2019, 11:36 AM
In D25921#579478, @apol wrote:

Just tested it, works okay.

Now the pen is broken. 😅

Oh right. But before you put any time into trying to fix it. I think I found a generic fix: There is a function in our libinput code setting the device input matrix dependent on rotation but I accidentally "deactivated" it some time ago when moving around code in the Screens class. I would look into that soon and then might revert the patch here as well (in case setting the matrix also fixes the touch events).

Okay, a generic solution from libinput could break on multiscreen. This patch works, checked yesterday.

ngraham edited the summary of this revision. (Show Details)Feb 12 2020, 9:43 PM
This revision was automatically updated to reflect the committed changes.