Provide a fake approach to tablet event propagation
ClosedPublic

Authored by apol on Dec 5 2019, 2:54 PM.

Details

Summary

At the moment, the state of wayland of getting such events isn't all
that clear. There's a zwp_tablet protocol that isn't stable yet and more
importantly isn't supported by Qt just yet.
Have it move and click the mouse about for now.

Depends on D25663 and D25763

Diff Detail

Repository
R108 KWin
Branch
input3
Lint
Lint SkippedExcuse: x
Unit
No Unit Test Coverage
Build Status
Buildable 19519
Build 19537: arc lint + arc unit
apol created this revision.Dec 5 2019, 2:54 PM
Restricted Application added a project: KWin. · View Herald TranscriptDec 5 2019, 2:54 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
apol requested review of this revision.Dec 5 2019, 2:54 PM
zzag added a subscriber: zzag.Dec 5 2019, 4:24 PM
zzag added inline comments.
pointer_input.h
60

Wouldn't it be better to have an utility function that one can use to get a button code for the given Qt::MouseButton?

API-wise, I think we need something like this

Qt::MouseButton buttonToQtMouseButton(uint32_t button);
uint32_t qtToButtonMouseButton(Qt::MouseButton button);
apol added inline comments.Dec 5 2019, 4:54 PM
pointer_input.h
60

Why add a function nobody needs? The function is already present, only not exposed to the header.

zzag added inline comments.Dec 5 2019, 5:24 PM
pointer_input.h
60

I'm asking you only to replace buttonCodeToQt with the utility function.

// pointer_input.h

uint32_t qtToButtonMouseButton(Qt::MouseButton button);

// pointer_input.cpp

uint32_t qtToButtonMouseButton(Qt::MouseButton button)
{
    return s_buttonToQtMouseButton.key(button);
}
romangg added a subscriber: romangg.Dec 5 2019, 6:42 PM
romangg added inline comments.
pointer_input.h
60

Yea, definitely makes sense. Also that the function for the other direction is not implemented.

romangg added inline comments.Dec 5 2019, 6:50 PM
pointer_input.h
60

I meant "not exposed"

apol added inline comments.Dec 6 2019, 12:43 AM
pointer_input.h
60

I agree it's better as a function, I was asked to return a hash in this comment here
https://phabricator.kde.org/D25663?id=70691#inline-144704

Maybe I misunderstood, @romangg can you confirm?

romangg added inline comments.Dec 6 2019, 8:03 AM
pointer_input.h
60

Yea, this was a misunderstanding. I meant there the internal representation should be changed to being a hash instead of a switch-statement in a separate patch (as you did in D25763), but I didn't mean that the getter should return the full hash, only that the getter should be exposed as well in a separate patch.

apol marked an inline comment as done.Dec 9 2019, 10:36 AM
apol updated this revision to Diff 71115.Dec 9 2019, 10:37 AM

Address function name

romangg added inline comments.Dec 9 2019, 12:59 PM
pointer_input.cpp
95

Forgot to remove?

apol marked an inline comment as done.Dec 9 2019, 1:18 PM
apol updated this revision to Diff 71119.Dec 9 2019, 1:19 PM

Remove unused function

romangg accepted this revision.Dec 10 2019, 1:52 PM

Let's go with this filter approach for now. Later we can look into if and how we want to align it with our current touch to pointer fallback in KWayland. I will create a task for that.

This revision is now accepted and ready to land.Dec 10 2019, 1:52 PM
This revision was automatically updated to reflect the committed changes.