[tests] Add pointer constraints test
AbandonedPublic

Authored by romangg on May 31 2018, 2:18 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Frameworks
Maniphest Tasks
T8923: Improve cursor locking and confining
Summary

To better test the usage of pointer confinement and locking I wrote this test
application.

For now it works only with the Wayland QPA. In a future patch an X backend
shall be added to also observe pointer constraining under Xwayland.

Diff Detail

Repository
R127 KWayland
Branch
pointerConstraintsTest
Lint
No Linters Available
Unit
No Unit Test Coverage
romangg created this revision.May 31 2018, 2:18 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 31 2018, 2:18 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.May 31 2018, 2:18 PM
romangg edited the summary of this revision. (Show Details)May 31 2018, 2:20 PM

There are some visual glitches with the QWidget code. If there are simple fixes for that, I will very happily do them. Otherwise since it's just a test application, it isn't really worth the effort. I also thought about using QGraphicsAnchorLayout, instead of normal Layouts. But I'm not sure if this would be better in the end.

romangg updated this revision to Diff 35265.May 31 2018, 3:25 PM
  • Cleanup one shot constraints

It could make more sense to have this test in KWin instead of KWayland. Especially when later on the Xwayland backend is added (would be optional on compile time though). Any opinions on this?

zzag added a subscriber: zzag.May 31 2018, 6:46 PM

Some nitpicks. :-)

tests/pointerconstraints.cpp
51

Coding style nitpick: put { on a new line.

170

IMHO, that's not the best case to use auto.

176

What about

if (!confinedPointer) {
    qDebug() << "ERROR when receiving confined pointer!";
    return;
}

// ...

?

325

Coding style nitpick: no else after return.

403

Is there a reason why the moc file is included?

romangg abandoned this revision.Jun 8 2018, 11:19 PM

I decided to add the test to KWin instead with: D13439

Thanks to Vlad for review comments. I incorporated them in the new patch for KWin.