[libinput] Load/store device configuration
ClosedPublic

Authored by graesslin on Nov 4 2016, 3:01 PM.

Details

Summary

Device gets a KConfigGroup injected and supports loading device-specific
settings. This is invoked from Libinput::Connection when adding a new
Device.

Whenever a Device option is changed successfully through the DBus
interface it gets synced into the KConfigGroup, thus on next loading of
the Device it gets restored.

The config group follows a pattern of:
[libinput][vendor][product]

Thus every device has a specific and persistent configuration.

Test Plan

So far only tested through autotests

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 7905.Nov 4 2016, 3:01 PM
graesslin retitled this revision from to [libinput] Load/store device configuration.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptNov 4 2016, 3:01 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript

And tested on real hardware. Seems to work :-)

It's funny (is it?) that I'm just doing the same. I should have told you I guess :)
Your solution is simpler anyway. My solution involves inputdevice.kcfg.
I don't think the [vendor][product] key is sufficient. I have two DELL devices here with the same product code, but different name and different functionality. I suggest the key to be [vendor][product][name].

graesslin updated this revision to Diff 7906.Nov 4 2016, 3:30 PM

Added name as additional config group argument

It's funny (is it?) that I'm just doing the same. I should have told you I guess :)
Your solution is simpler anyway. My solution involves inputdevice.kcfg.

I also wanted to use kcfg in the first place, but as it's difficult to inject the KConfigGroup I decided against and came up with the slightly too complex template magic.

Works for me.

[Libinput][1133][50184][Logitech USB Trackball]
MiddleButtonEmulation=true
ScrollButton=275

[Libinput][1739][30171][DLL0675:00 06CB:75DB Touchpad]
TapToClick=true
hein accepted this revision.Nov 7 2016, 9:37 AM
hein added a reviewer: hein.
This revision is now accepted and ready to land.Nov 7 2016, 9:37 AM
This revision was automatically updated to reflect the committed changes.