Support cursor hints on locked pointer
ClosedPublic

Authored by romangg on Jul 17 2018, 12:42 AM.

Details

Summary

Implement support for locked pointer cursor hints. Cursor hints can be
retrieved by the compositor either continuously by connecting to the
cursorHintChanged signal or only when needed. In the later case the
compositor must connect to the aboutToUnbound signal of the locked pointer
interface in order to fetch the last hint before the interface is unbound.

Test Plan

Autotest added.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Jul 17 2018, 12:42 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 17 2018, 12:42 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.Jul 17 2018, 12:42 AM
romangg updated this revision to Diff 37917.Jul 17 2018, 12:46 AM
  • Cleanup: remove hint getter
romangg updated this revision to Diff 37938.Jul 17 2018, 9:12 AM
  • Add autotest
davidedmundson requested changes to this revision.Jul 17 2018, 9:25 AM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
autotests/client/test_pointer_constraints.cpp
258

We should check the value of hintChangedSpy.first() to properly test it.

Also, use something better than 1,0 to check y is set correctly

src/server/pointerconstraints_interface.h
126–144

do we not want a getter method?

One of kwayland's main roles is to be a property cache

193

@since

src/server/pointerconstraints_interface_v1.cpp
175

Only non-negative x and y values are allowed

is it worth enforcing that with a check here?

This revision now requires changes to proceed.Jul 17 2018, 9:25 AM
romangg added inline comments.Jul 17 2018, 11:17 AM
src/server/pointerconstraints_interface.h
126–144

The hint is used by the compositor after unlock again. This unlock can also happen on destruction of the LockedPointerInterface. So one need to to connect to a signal announcing this and then set the pointer position.

Resource has a aboutToBeUnbound signal. Maybe use this?

src/server/pointerconstraints_interface_v1.cpp
175

I wanted to allow negative values, such that a client can decide to opt-out of hinting again. Sadly the specs does not say anything about invalid values. But my assumption is that a client should only be allowed to shift the cursor in the dimensions of its surface.

romangg updated this revision to Diff 37971.Jul 17 2018, 4:25 PM
  • Add hint getter
  • Add since keyword
romangg marked 4 inline comments as done.Jul 17 2018, 4:26 PM
davidedmundson accepted this revision.Jul 17 2018, 4:26 PM
This revision is now accepted and ready to land.Jul 17 2018, 4:26 PM
romangg edited the summary of this revision. (Show Details)Jul 23 2018, 8:53 AM
romangg edited the test plan for this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.