Make it possible to have a separate cursor for the tablet
ClosedPublic

Authored by apol on Mar 20 2020, 2:14 AM.

Details

Summary

As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.

Test Plan

Tests pass, been using it and works as well as before but with beautiful tablet cursors.

Diff Detail

Repository
R108 KWin
Branch
arcpatch-D28155
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24484
Build 24502: arc lint + arc unit
apol created this revision.Mar 20 2020, 2:14 AM
Restricted Application added a project: KWin. · View Herald TranscriptMar 20 2020, 2:14 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
apol requested review of this revision.Mar 20 2020, 2:14 AM
apol updated this revision to Diff 78068.Mar 20 2020, 2:50 AM

arc put this part on the previous patch 8-)

apol updated this revision to Diff 78351.Mar 24 2020, 1:15 PM

rebase

apol retitled this revision from WIP: Make it possible to have a separate cursor for the tablet to Make it possible to have a separate cursor for the tablet.Mar 24 2020, 2:32 PM
apol edited the test plan for this revision. (Show Details)
cblack accepted this revision.Mar 30 2020, 2:44 PM
cblack added a subscriber: cblack.

Works as advertised, and nothing stands out to me as needing improvement in the code, buuut I would probably wait on the review of a more experienced KWin person.

It would probably be better from a UX perspective to render multiple cursors, one per input device, as it's jarring when the visual cursor jumps around switching between input devices. It took me a while to verify that the cursors for my tablet and my mouse were actually moving independently. Not sure that's within the scope of this patch, though.

This revision is now accepted and ready to land.Mar 30 2020, 2:44 PM
davidedmundson requested changes to this revision.Mar 30 2020, 2:46 PM
davidedmundson added a subscriber: davidedmundson.

Idea seems sensible.

autotests/integration/pointer_input.cpp
172

why is this needed?

cursor.cpp
49

What happens when a cursor is deleted? For the tablet case it's parented to the tool

This revision now requires changes to proceed.Mar 30 2020, 2:46 PM

Just noticed that a cursor renders at 0,0 when exiting the session with this patch.

apol added a comment.Mar 30 2020, 3:27 PM

It would probably be better from a UX perspective to render multiple cursors, one per input device, as it's jarring when the visual cursor jumps around switching between input devices.

Agreed. It needs some additional work on the DrmBackend (or any backend that wants it really) and figured the patch is big enough as is. Would be a nice thing to add later, not that hard to do either I'd say.

apol updated this revision to Diff 78921.Mar 30 2020, 5:09 PM
apol marked 2 inline comments as done.

Address David's comments

davidedmundson accepted this revision.Apr 2 2020, 11:28 AM
This revision is now accepted and ready to land.Apr 2 2020, 11:28 AM
This revision was automatically updated to reflect the committed changes.