[libinput] Support for left-handed pointer
ClosedPublic

Authored by graesslin on May 6 2016, 7:57 AM.

Details

Summary

The configuration file kcminput, group Mouse is parsed to decide whether
pointer devices should be in left handed mode. The config is applied
whenever a new device is added.

In addition the Connection listens to KGlobalSettings for a mouse
settings changed signal which might be emitted by the mouse KCM.

When such a signal is emitted, all pointer devices are reconfigured.

This allows to change the mouse handed settings on Wayland.

Diff Detail

Repository
R108 KWin
Branch
linput-left-handed
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin updated this revision to Diff 3657.May 6 2016, 7:57 AM
graesslin retitled this revision from to [libinput] Support for left-handed pointer.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 6 2016, 7:57 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik added a subscriber: broulik.May 6 2016, 8:26 AM
broulik added inline comments.
libinput/device.cpp
135 ↗(On Diff #3657)

I wouldn't emit that if it didn't actually change

graesslin updated this revision to Diff 3658.May 6 2016, 9:06 AM

Set default value for left handed if there is no config key

graesslin marked an inline comment as done.May 9 2016, 7:11 AM
graesslin updated this revision to Diff 3718.May 9 2016, 7:14 AM

Only emit changes if things changed

broulik added inline comments.May 11 2016, 10:15 AM
libinput/connection.cpp
346 ↗(On Diff #3657)

Why this extra check?

358 ↗(On Diff #3657)

std::for_each?

graesslin added inline comments.May 11 2016, 11:56 AM
libinput/connection.cpp
358 ↗(On Diff #3657)

I don't like the std::for_each that much as I find it difficult to use if one doesn't have a method to invoke. In this case I think putting the logic into a lambda is a little bit overhead.

graesslin added inline comments.May 11 2016, 11:57 AM
libinput/connection.cpp
346 ↗(On Diff #3657)

I tried to follow the logic of the mouse kcm which doesn't have a default. The idea would be to set the device default if nothing is configured.

But as we don't do that one could indeed just change it to the one call. Will update

graesslin updated this revision to Diff 3759.May 11 2016, 12:02 PM

Removed the weird reading of MouseButtonMapping settings

broulik accepted this revision.May 11 2016, 12:04 PM
broulik added a reviewer: broulik.
broulik added inline comments.
libinput/connection.cpp
358 ↗(On Diff #3657)

Ok, fine, at least cache constEnd() :)

for (auto it = foo.constBegin(), end = foo.constEnd(); it != end; ++it)

This revision is now accepted and ready to land.May 11 2016, 12:04 PM
This revision was automatically updated to reflect the committed changes.