kcms: Get rid of QDBusInterface and modernize touchpad KCM

kcms/libkwindevices: Use new device-specific List methods

Instead of getting all devices and filtering them, we can now ask KWin for a list of devices of a certain kind.

This reduces DBus traffic to a single call on creation of the model. A custom filter can still be provided to e.g. narrow down pointer to touchpad only.

We still have to introspect the device when it gets added to see whether it is relevant but that's just a single additional call compared to the ones we did initially.

Also puts it in a namespace to avoid future clashes of "InputDevice" in the KCMs.

kcms/touchpad: Modernize to be on par with mouse KCM

The mouse KCM received a lot of love over time, being ported from QQuickWidget to a proper QuickKCM, better needsSave handling and so on. The touchpad KCM hasn't followed suit.

This applies most of those improvements to the touchpad KCM and also ports it to DevicesModel and away from QDBusInterface to reduce the number of DBus calls.

Long term we probably want to try to unify the code bases since there's a lot of duplication with subtle differences involved here.

kcms/mouse: Make use of KWinDevices DevicesModel

Replaces the excess use of QDBusInterface with the devices model. Ideally, we just used the InputDevices from the model rather than duplicating everything here but that is a story for another time.

@nicolasfella @davidedmundson @jpetso @redstrate

This significantly reduces the number of DBus calls being issued to KWin which was exacerbated by the fact that we load all the input stuff on systemsettings startup through kcmodule data.

I didn’t expect to copy paste half of mouse kcm to touchpad kcm though...

Only tested on Wayland. Hotplug of mice works, and changing touchpad settings. Needs a lot more testing I suppose. Should look exactly the same as before. I don’t have a graphics tablet.

Edited by Kai Uwe Broulik

Merge request reports

Loading