mirror-kde-plasma-desktop/kcms/touchpad/kcm/touchpadconfigcontainer.cpp
Nicolas Fella 12ac086128 [kcm/touchpad] Drop synaptics config
The synaptics touchpad driver has mostly been superseeded by libinput.

For libinput we have a completely different UI.

The KCM currently still supports both, making the code massively complex and
causing a huge maintanance burden.

Given the long-term focus is on Wayland and libinput drop the synaptic integration.

This doesn't prevent anyone from using Plasma X11 with Synaptics, but there will
not be a first-party config UI for it any more

See https://invent.kde.org/plasma/plasma-desktop/-/issues/79
2023-10-02 21:24:09 +00:00

67 lines
1.4 KiB
C++

/*
SPDX-FileCopyrightText: 2017 Roman Gilg <subdiff@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "touchpadconfigcontainer.h"
#include "../logging.h"
#include "libinput/touchpadconfiglibinput.h"
#include "touchpadbackend.h"
#include "touchpadconfigplugin.h"
#include <config-build-options.h>
#include <KPluginFactory>
#include <KWindowSystem>
K_PLUGIN_CLASS_WITH_JSON(TouchpadConfigContainer, "kcm_touchpad.json")
extern "C" {
Q_DECL_EXPORT void kcminit()
{
#if BUILD_KCM_TOUCHPAD_X11
if (KWindowSystem::isPlatformX11()) {
TouchpadConfigContainer::kcmInit();
}
#endif
}
}
TouchpadConfigContainer::TouchpadConfigContainer(QObject *parent, const KPluginMetaData &data)
: KCModule(parent, data)
, m_plugin(nullptr)
{
TouchpadBackend *backend = TouchpadBackend::implementation();
m_plugin = new TouchpadConfigLibinput(this, backend);
setButtons(KCModule::Default | KCModule::Apply);
}
void TouchpadConfigContainer::kcmInit()
{
#if BUILD_KCM_TOUCHPAD_X11
TouchpadBackend *backend = TouchpadBackend::implementation();
if (backend->getMode() == TouchpadInputBackendMode::XLibinput) {
backend->getConfig();
backend->applyConfig();
}
#endif
}
void TouchpadConfigContainer::load()
{
m_plugin->load();
}
void TouchpadConfigContainer::save()
{
m_plugin->save();
}
void TouchpadConfigContainer::defaults()
{
m_plugin->defaults();
}
#include "touchpadconfigcontainer.moc"