2017-01-11 01:41:05 -09:00
|
|
|
/*
|
2021-05-20 21:53:47 -08:00
|
|
|
SPDX-FileCopyrightText: 2017 Roman Gilg <subdiff@gmail.com>
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
2017-01-11 01:41:05 -09:00
|
|
|
|
|
|
|
|
#include "touchpadconfigcontainer.h"
|
2023-07-19 16:50:34 -08:00
|
|
|
|
|
|
|
|
#include "../logging.h"
|
2021-03-07 03:53:56 -09:00
|
|
|
#include "libinput/touchpadconfiglibinput.h"
|
[libinput-touchpad-kcm] Use wayland specific touchpad KCM UI when libinput is used on X11
Summary:
Earlier when libinput was used on X11, XInput specific UI was shown, due to which most of the options were grayed out.
Now we show libinput specific UI that is already used on wayland if libinput driver is used on X11.
- loaded all libinput properties that are available on X11.
- exposed all Q_PROPERTY to Libinput specific UI.
FEATURE: 387153
FEATURE: 392709
FIXED-IN: 5.16.0
Reviewers: ngraham, romangg, davidedmundson, #plasma
Reviewed By: ngraham, romangg, #plasma
Subscribers: GB_2, jriddell, knambiar, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D20186
2019-05-14 06:38:40 -08:00
|
|
|
#include "touchpadbackend.h"
|
2017-01-11 01:41:05 -09:00
|
|
|
#include "touchpadconfigplugin.h"
|
2023-07-19 16:50:34 -08:00
|
|
|
#include <config-build-options.h>
|
|
|
|
|
|
2021-03-07 03:53:56 -09:00
|
|
|
#include <KPluginFactory>
|
2023-03-10 09:11:57 -09:00
|
|
|
#include <KWindowSystem>
|
2021-03-07 03:53:56 -09:00
|
|
|
|
2021-11-14 09:23:47 -09:00
|
|
|
K_PLUGIN_CLASS_WITH_JSON(TouchpadConfigContainer, "kcm_touchpad.json")
|
2017-01-11 01:41:05 -09:00
|
|
|
|
|
|
|
|
extern "C" {
|
2021-11-14 09:23:47 -09:00
|
|
|
Q_DECL_EXPORT void kcminit()
|
2017-01-11 01:41:05 -09:00
|
|
|
{
|
2023-07-19 16:50:34 -08:00
|
|
|
#if BUILD_KCM_TOUCHPAD_X11
|
2017-01-11 01:41:05 -09:00
|
|
|
if (KWindowSystem::isPlatformX11()) {
|
2019-05-16 03:15:35 -08:00
|
|
|
TouchpadConfigContainer::kcmInit();
|
2017-01-11 01:41:05 -09:00
|
|
|
}
|
2023-07-19 16:50:34 -08:00
|
|
|
#endif
|
2017-01-11 01:41:05 -09:00
|
|
|
}
|
2021-01-20 11:58:28 -09:00
|
|
|
}
|
2017-01-11 01:41:05 -09:00
|
|
|
|
2023-06-09 05:39:54 -08:00
|
|
|
TouchpadConfigContainer::TouchpadConfigContainer(QObject *parent, const KPluginMetaData &data)
|
|
|
|
|
: KCModule(parent, data)
|
2023-07-19 16:50:34 -08:00
|
|
|
, m_plugin(nullptr)
|
2017-01-11 01:41:05 -09:00
|
|
|
{
|
2023-04-23 05:18:43 -08:00
|
|
|
TouchpadBackend *backend = TouchpadBackend::implementation();
|
|
|
|
|
m_plugin = new TouchpadConfigLibinput(this, backend);
|
2022-01-05 07:52:06 -09:00
|
|
|
|
|
|
|
|
setButtons(KCModule::Default | KCModule::Apply);
|
2017-01-11 01:41:05 -09:00
|
|
|
}
|
|
|
|
|
|
2019-05-16 03:15:35 -08:00
|
|
|
void TouchpadConfigContainer::kcmInit()
|
|
|
|
|
{
|
2023-07-19 16:50:34 -08:00
|
|
|
#if BUILD_KCM_TOUCHPAD_X11
|
2019-05-16 03:15:35 -08:00
|
|
|
TouchpadBackend *backend = TouchpadBackend::implementation();
|
|
|
|
|
if (backend->getMode() == TouchpadInputBackendMode::XLibinput) {
|
|
|
|
|
backend->getConfig();
|
|
|
|
|
backend->applyConfig();
|
|
|
|
|
}
|
2023-07-19 16:50:34 -08:00
|
|
|
#endif
|
2019-05-16 03:15:35 -08:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigContainer::load()
|
|
|
|
|
{
|
|
|
|
|
m_plugin->load();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TouchpadConfigContainer::save()
|
|
|
|
|
{
|
|
|
|
|
m_plugin->save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TouchpadConfigContainer::defaults()
|
|
|
|
|
{
|
|
|
|
|
m_plugin->defaults();
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-07 03:53:56 -09:00
|
|
|
#include "touchpadconfigcontainer.moc"
|