diff --git a/CMakeLists.txt b/CMakeLists.txt index ead1893661..ba00589e42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,14 +213,6 @@ pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) ecm_find_qmlmodule(org.kde.pipewire 0.1) -find_package(Synaptics) -set_package_properties(Synaptics PROPERTIES TYPE OPTIONAL) -add_feature_info("Synaptics" SYNAPTICS_FOUND "Synaptics libraries are needed for the synaptics touchpad KCM") - -if(SYNAPTICS_FOUND) - set(HAVE_SYNAPTICS 1) -endif() - if(XORGLIBINPUT_FOUND) set(HAVE_XORGLIBINPUT 1) endif() diff --git a/cmake/modules/FindSynaptics.cmake b/cmake/modules/FindSynaptics.cmake deleted file mode 100644 index 4d8df408cb..0000000000 --- a/cmake/modules/FindSynaptics.cmake +++ /dev/null @@ -1,2 +0,0 @@ -# Have it in a find module to allow force disabling it via CMAKE_DISABLE_FIND_PACKAGE_ -pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) diff --git a/config-X11.h.cmake b/config-X11.h.cmake index 6c719e9bbd..581c8f7b26 100644 --- a/config-X11.h.cmake +++ b/config-X11.h.cmake @@ -1,4 +1,3 @@ #cmakedefine01 HAVE_XCURSOR #cmakedefine01 HAVE_XORGLIBINPUT #cmakedefine01 HAVE_X11 -#cmakedefine01 HAVE_SYNAPTICS diff --git a/kcms/touchpad/backends/x11.cmake b/kcms/touchpad/backends/x11.cmake index 97ca69dec1..88bf0c6764 100644 --- a/kcms/touchpad/backends/x11.cmake +++ b/kcms/touchpad/backends/x11.cmake @@ -10,10 +10,6 @@ SET(backend_SRCS backends/x11/xrecordkeyboardmonitor.cpp ) -if(SYNAPTICS_FOUND) - list(APPEND backend_SRCS backends/x11/synapticstouchpad.cpp) -endif() - if (XORGLIBINPUT_FOUND) SET(backend_SRCS @@ -38,10 +34,6 @@ SET(backend_LIBS PkgConfig::XORGSERVER ) -if(SYNAPTICS_FOUND) - list(APPEND backend_LIBS PkgConfig::SYNAPTICS) -endif() - add_executable(kcm-touchpad-list-devices backends/x11/listdevices.cpp) target_link_libraries(kcm-touchpad-list-devices X11::X11 diff --git a/kcms/touchpad/backends/x11/synapticstouchpad.cpp b/kcms/touchpad/backends/x11/synapticstouchpad.cpp deleted file mode 100644 index 37d60aa1ee..0000000000 --- a/kcms/touchpad/backends/x11/synapticstouchpad.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - SPDX-FileContributor: 2002-2005, 2007 Peter Osterlund - - SPDX-License-Identifier: GPL-2.0-or-later AND LicenseRef-synaptics -*/ - -#include -#include - -#include "synapticstouchpad.h" - -#include -#include -#include - -#define SYN_MAX_BUTTONS 12 - -const struct Parameter synapticsProperties[] = { - {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0}, - {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, - {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, - {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, - {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, - {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, - {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0}, - {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0}, - {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1}, - {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0}, - {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2}, - {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, - {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32, 0}, - {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, - {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, - {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, - {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, - {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, - {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, - {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, - {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 0}, - {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 1}, - {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0}, - {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1}, - {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2}, - /*{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},*/ - {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0}, - {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0}, - {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0}, - {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 1}, - {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 2}, - {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 3}, - {"OneFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4}, - {"TwoFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5}, - {"ThreeFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6}, - {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 0}, - {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 1}, - {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 2}, - {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0}, - {"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0}, - {"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0}, - {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0}, - {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0}, - {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1}, - {"CoastingSpeed", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 0}, - {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 1}, - {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0}, - {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1}, - {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 0}, - {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 1}, - {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0}, - {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0}, - {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0}, - {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1}, - {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2}, - {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3}, - {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 0}, - {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 1}, - {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0}, - {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0}, - {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1}, - {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2}, - {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3}, - {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4}, - {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5}, - {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6}, - {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7}, - {NULL, PT_INT, 0, 0, nullptr, 0, 0}, -}; - -SynapticsTouchpad::SynapticsTouchpad(Display *display, int deviceId) - : XlibTouchpad(display, deviceId) - , m_resX(1) - , m_resY(1) -{ - m_capsAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); - m_touchpadOffAtom.intern(m_connection, SYNAPTICS_PROP_OFF); - XcbAtom resolutionAtom(m_connection, SYNAPTICS_PROP_RESOLUTION); - XcbAtom edgesAtom(m_connection, SYNAPTICS_PROP_EDGES); - - loadSupportedProperties(synapticsProperties); - - m_toRadians.append("CircScrollDelta"); - - PropertyInfo edges(m_display, m_deviceId, edgesAtom, 0); - if (edges.i && edges.nitems == 4) { - int w = qAbs(edges.i[1] - edges.i[0]); - int h = qAbs(edges.i[3] - edges.i[2]); - m_resX = w / 90; - m_resY = h / 50; - qDebug() << "Width: " << w << " height: " << h; - qDebug() << "Approx. resX: " << m_resX << " resY: " << m_resY; - } - - PropertyInfo resolution(m_display, m_deviceId, resolutionAtom, 0); - if (resolution.i && resolution.nitems == 2 && resolution.i[0] > 1 && resolution.i[1] > 1) { - m_resY = qMin(static_cast(resolution.i[0]), static_cast(INT_MAX)); - m_resX = qMin(static_cast(resolution.i[1]), static_cast(INT_MAX)); - qDebug() << "Touchpad resolution: x: " << m_resX << " y: " << m_resY; - } - - m_scaleByResX.append("HorizScrollDelta"); - m_scaleByResY.append("VertScrollDelta"); - m_scaleByResX.append("MaxTapMove"); - m_scaleByResY.append("MaxTapMove"); - - m_resX = qMax(10, m_resX); - m_resY = qMax(10, m_resY); - qDebug() << "Final resolution x:" << m_resX << " y:" << m_resY; - m_negate["HorizScrollDelta"] = "InvertHorizScroll"; - m_negate["VertScrollDelta"] = "InvertVertScroll"; - m_supported.append(m_negate.values()); - m_supported.append("Coasting"); - - PropertyInfo caps(m_display, m_deviceId, m_capsAtom.atom(), 0); - if (!caps.b) { - return; - } - - enum TouchpadCapabilitiy { - TouchpadHasLeftButton, - TouchpadHasMiddleButton, - TouchpadHasRightButton, - TouchpadTwoFingerDetect, - TouchpadThreeFingerDetect, - TouchpadPressureDetect, - TouchpadPalmDetect, - TouchpadCapsCount, - }; - - QVector cap(TouchpadCapsCount, false); - std::copy(caps.b, caps.b + qMin(cap.size(), static_cast(caps.nitems)), cap.begin()); - - if (!cap[TouchpadTwoFingerDetect]) { - m_supported.removeAll("HorizTwoFingerScroll"); - m_supported.removeAll("VertTwoFingerScroll"); - m_supported.removeAll("TwoFingerTapButton"); - } - - if (!cap[TouchpadThreeFingerDetect]) { - m_supported.removeAll("ThreeFingerTapButton"); - } - - if (!cap[TouchpadPressureDetect]) { - m_supported.removeAll("FingerHigh"); - m_supported.removeAll("FingerLow"); - - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("PressureMotionMinZ"); - m_supported.removeAll("PressureMotionMinFactor"); - m_supported.removeAll("PressureMotionMaxZ"); - m_supported.removeAll("PressureMotionMaxFactor"); - m_supported.removeAll("EmulateTwoFingerMinZ"); - } - - if (!cap[TouchpadPalmDetect]) { - m_supported.removeAll("PalmDetect"); - m_supported.removeAll("PalmMinWidth"); - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("EmulateTwoFingerMinW"); - } - - for (QMap::Iterator i = m_negate.begin(); i != m_negate.end(); ++i) { - if (!m_supported.contains(i.key())) { - m_supported.removeAll(i.value()); - } - } - - m_paramList = synapticsProperties; -} - -void SynapticsTouchpad::setTouchpadOff(int touchpadOff) -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - if (off.b && *(off.b) != touchpadOff) { - *(off.b) = touchpadOff; - off.set(); - } - - flush(); -} - -int SynapticsTouchpad::touchpadOff() -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - return off.value(0).toInt(); -} - -XcbAtom &SynapticsTouchpad::touchpadOffAtom() -{ - return m_touchpadOffAtom; -} - -double SynapticsTouchpad::getPropertyScale(const QString &name) const -{ - if (m_scaleByResX.contains(name) && m_scaleByResY.contains(name)) { - return std::sqrt(static_cast(m_resX) * m_resX + static_cast(m_resY) * m_resY); - } else if (m_scaleByResX.contains(name)) { - return m_resX; - } else if (m_scaleByResY.contains(name)) { - return m_resY; - } else if (m_toRadians.contains(name)) { - return M_PI_4 / 45.0; - } - return 1.0; -} diff --git a/kcms/touchpad/backends/x11/synapticstouchpad.h b/kcms/touchpad/backends/x11/synapticstouchpad.h deleted file mode 100644 index 20c6988100..0000000000 --- a/kcms/touchpad/backends/x11/synapticstouchpad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SPDX-FileCopyrightText: 2015 Weng Xuetian - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include "xcbatom.h" -#include "xlibtouchpad.h" - -class SynapticsTouchpad : public QObject, public XlibTouchpad -{ - Q_OBJECT - -public: - SynapticsTouchpad(Display *display, int deviceId); - - void setTouchpadOff(int touchpadOff) override; - int touchpadOff() override; - - XcbAtom &touchpadOffAtom() override; - -protected: - double getPropertyScale(const QString &name) const override; - -private: - XcbAtom m_capsAtom, m_touchpadOffAtom; - int m_resX, m_resY; - QStringList m_scaleByResX, m_scaleByResY, m_toRadians; -}; diff --git a/kcms/touchpad/backends/x11/xlibbackend.cpp b/kcms/touchpad/backends/x11/xlibbackend.cpp index 451593d445..0bf5c032e2 100644 --- a/kcms/touchpad/backends/x11/xlibbackend.cpp +++ b/kcms/touchpad/backends/x11/xlibbackend.cpp @@ -26,9 +26,6 @@ #include #include -#if HAVE_SYNAPTICS -#include -#endif #include struct DeviceListDeleter { @@ -80,9 +77,6 @@ XlibBackend::XlibBackend(QObject *parent) m_touchpadAtom.intern(m_connection, XI_TOUCHPAD); m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); -#if HAVE_SYNAPTICS - m_synapticsIdentifierAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); -#endif m_libinputIdentifierAtom.intern(m_connection, "libinput Send Events Modes Available"); m_device.reset(findTouchpad()); @@ -112,12 +106,6 @@ XlibTouchpad *XlibBackend::findTouchpad() setMode(TouchpadInputBackendMode::XLibinput); return new LibinputTouchpad(m_display.get(), info->id); } -#endif -#if HAVE_SYNAPTICS - if (*atom == m_synapticsIdentifierAtom.atom()) { - setMode(TouchpadInputBackendMode::XSynaptics); - return new SynapticsTouchpad(m_display.get(), info->id); - } #endif } } @@ -348,13 +336,6 @@ QVector XlibBackend::getDevices() const } #endif -#if HAVE_SYNAPTICS - SynapticsTouchpad *synaptics = dynamic_cast(m_device.get()); - if (synaptics) { - touchpads.push_back(synaptics); - } -#endif - return touchpads; } diff --git a/kcms/touchpad/backends/x11/xlibbackend.h b/kcms/touchpad/backends/x11/xlibbackend.h index 280cc85499..bd0c37b3bd 100644 --- a/kcms/touchpad/backends/x11/xlibbackend.h +++ b/kcms/touchpad/backends/x11/xlibbackend.h @@ -13,7 +13,6 @@ #include #include "libinputtouchpad.h" -#include "synapticstouchpad.h" #include "touchpadbackend.h" #include "xlibtouchpad.h" @@ -83,7 +82,6 @@ protected: xcb_connection_t *m_connection; XcbAtom m_enabledAtom, m_mouseAtom, m_keyboardAtom, m_touchpadAtom; - XcbAtom m_synapticsIdentifierAtom; XcbAtom m_libinputIdentifierAtom; XlibTouchpad *findTouchpad(); diff --git a/kcms/touchpad/kcm/CMakeLists.txt b/kcms/touchpad/kcm/CMakeLists.txt index 7b15da79f4..68eb5fd795 100644 --- a/kcms/touchpad/kcm/CMakeLists.txt +++ b/kcms/touchpad/kcm/CMakeLists.txt @@ -5,27 +5,6 @@ set(KCM_TOUCHPAD_SRCS resources.qrc ) -if (BUILD_KCM_TOUCHPAD_X11) - set(KCM_TOUCHPAD_SRCS - ${KCM_TOUCHPAD_SRCS} - xlib/customslider.cpp - xlib/sliderpair.cpp - xlib/testarea.cpp - xlib/testbutton.cpp - xlib/touchpadconfigxlib.cpp - xlib/customconfigdialogmanager.cpp - ) - - ki18n_wrap_ui(KCM_TOUCHPAD_SRCS - xlib/ui/pointermotion.ui - xlib/ui/tap.ui - xlib/ui/scroll.ui - xlib/ui/sensitivity.ui - xlib/ui/kded.ui - xlib/ui/testarea.ui - ) -endif() - add_library(kcm_touchpad MODULE ${KCM_TOUCHPAD_SRCS}) kcmutils_generate_desktop_file(kcm_touchpad) diff --git a/kcms/touchpad/kcm/touchpadconfigcontainer.cpp b/kcms/touchpad/kcm/touchpadconfigcontainer.cpp index 3e0326df8e..a112b34ad4 100644 --- a/kcms/touchpad/kcm/touchpadconfigcontainer.cpp +++ b/kcms/touchpad/kcm/touchpadconfigcontainer.cpp @@ -10,13 +10,8 @@ #include "libinput/touchpadconfiglibinput.h" #include "touchpadbackend.h" #include "touchpadconfigplugin.h" - #include -#if BUILD_KCM_TOUCHPAD_X11 -#include "xlib/touchpadconfigxlib.h" -#endif - #include #include @@ -37,29 +32,8 @@ TouchpadConfigContainer::TouchpadConfigContainer(QObject *parent, const KPluginM : KCModule(parent, data) , m_plugin(nullptr) { - if (TouchpadBackend *backend = TouchpadBackend::implementation(); backend != nullptr) { - switch (backend->getMode()) { -#if BUILD_KCM_TOUCHPAD_X11 - case TouchpadInputBackendMode::XLibinput: - case TouchpadInputBackendMode::Unset: - m_plugin = new TouchpadConfigLibinput(this, backend); - break; - case TouchpadInputBackendMode::XSynaptics: - m_plugin = new TouchpadConfigXlib(this, backend); - break; -#endif -#if BUILD_KCM_TOUCHPAD_KWIN_WAYLAND - case TouchpadInputBackendMode::WaylandLibinput: - m_plugin = new TouchpadConfigLibinput(this, backend); - break; -#endif - default: - Q_UNUSED(m_plugin); - } - } - if (m_plugin == nullptr) { - qFatal("Not able to select appropriate configuration plugin, aborting kcm_touchpad startup"); - } + TouchpadBackend *backend = TouchpadBackend::implementation(); + m_plugin = new TouchpadConfigLibinput(this, backend); setButtons(KCModule::Default | KCModule::Apply); } @@ -71,8 +45,6 @@ void TouchpadConfigContainer::kcmInit() if (backend->getMode() == TouchpadInputBackendMode::XLibinput) { backend->getConfig(); backend->applyConfig(); - } else if (backend->getMode() == TouchpadInputBackendMode::XSynaptics) { - TouchpadConfigXlib::kcmInit(); } #endif } diff --git a/kcms/touchpad/kcm/touchpadconfigcontainer.h b/kcms/touchpad/kcm/touchpadconfigcontainer.h index c952da7679..7929e43edc 100644 --- a/kcms/touchpad/kcm/touchpadconfigcontainer.h +++ b/kcms/touchpad/kcm/touchpadconfigcontainer.h @@ -11,13 +11,11 @@ class TouchpadConfigPlugin; class TouchpadConfigLibinput; -class TouchpadConfigXlib; class TouchpadConfigContainer : public KCModule { Q_OBJECT - friend TouchpadConfigXlib; friend TouchpadConfigLibinput; public: diff --git a/kcms/touchpad/kcm/xlib/customconfigdialogmanager.cpp b/kcms/touchpad/kcm/xlib/customconfigdialogmanager.cpp deleted file mode 100644 index ca3cb981ca..0000000000 --- a/kcms/touchpad/kcm/xlib/customconfigdialogmanager.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "customconfigdialogmanager.h" - -#include - -#include -#include - -#include -#include -#include - -#include "customslider.h" - -CustomConfigDialogManager::CustomConfigDialogManager(QWidget *parent, KCoreConfigSkeleton *conf, const QStringList &supported) - : KConfigDialogManager(parent, conf) - , m_config(conf) -{ - static const QString kcfgPrefix("kcfg_"); - - const auto itemList = conf->items(); - for (KConfigSkeletonItem *i : itemList) { - QString name(i->name()); - - QWidget *child = parent->findChild(kcfgPrefix + name); - if (!child) { - continue; - } - m_widgets[name] = child; - - /* FIXME: this should probably be less hackish */ - if (name == "Tapping" && !supported.contains("Tapping")) - qobject_cast(child)->setCheckable(false); - else if (!supported.contains(name)) { - child->setEnabled(false); - } - - KCoreConfigSkeleton::ItemEnum *asEnum = dynamic_cast(i); - if (!asEnum) { - continue; - } - - QStringList choiceList; - const auto asEnumChoices = asEnum->choices(); - for (const auto &choice : asEnumChoices) { - choiceList.append(!choice.label.isEmpty() ? choice.label : choice.name); - } - - KComboBox *asComboBox = qobject_cast(child); - if (asComboBox) { - asComboBox->addItems(choiceList); - } - } -} - -CustomConfigDialogManager::~CustomConfigDialogManager() -{ -} - -QVariantHash CustomConfigDialogManager::currentWidgetProperties() const -{ - QVariantHash r; - for (QMap::ConstIterator i = m_widgets.begin(); i != m_widgets.end(); ++i) { - r[i.key()] = property(i.value()); - } - return r; -} - -void CustomConfigDialogManager::setWidgetProperties(const QVariantHash &p) -{ - for (QVariantHash::ConstIterator i = p.begin(); i != p.end(); ++i) { - QMap::ConstIterator j = m_widgets.constFind(i.key()); - if (j != m_widgets.constEnd()) { - setProperty(j.value(), i.value()); - } - } -} - -static bool variantFuzzyCompare(const QVariant &a, const QVariant &b) -{ - if (a == b) { - return true; - } - - bool isDouble_a = false, isDouble_b = false; - float d_a = static_cast(a.toDouble(&isDouble_a)), d_b = static_cast(b.toDouble(&isDouble_b)); - if (!isDouble_a || !isDouble_b) { - return false; - } - - return (qFuzzyIsNull(d_a) && qFuzzyIsNull(d_b)) || qFuzzyCompare(d_a, d_b); -} - -QVariant CustomConfigDialogManager::fixup(QWidget *widget, QVariant v) const -{ - bool isDouble = false; - double value = v.toDouble(&isDouble); - if (!isDouble) { - return v; - } - - QVariant decimals(widget->property("decimals")); - if (decimals.typeId() != QMetaType::Type::Int) { - CustomSlider *asSlider = qobject_cast(widget); - if (asSlider) { - return asSlider->fixup(value); - } - return value; - } - - double k = std::pow(10.0, decimals.toInt()); - return std::floor(value * k + 0.5) / k; // round -} - -bool CustomConfigDialogManager::compareWidgetProperties(const QVariantHash &p) const -{ - bool result = true; - for (QVariantHash::ConstIterator i = p.begin(); i != p.end(); ++i) { - QMap::ConstIterator j = m_widgets.find(i.key()); - if (j == m_widgets.end()) { - continue; - } - - QWidget *widget = j.value(); - QVariant widgetValue(fixup(widget, property(widget))); - QVariant fixed(fixup(widget, i.value())); - if (!variantFuzzyCompare(widgetValue, fixed)) { - result = false; - qDebug() << "Config mismatch:" << widget->objectName() << widgetValue << fixed; - } - } - return result; -} - -bool CustomConfigDialogManager::hasChangedFuzzy() const -{ - for (QMap::ConstIterator i = m_widgets.begin(); i != m_widgets.end(); ++i) { - KConfigSkeletonItem *config = m_config->findItem(i.key()); - QWidget *widget = i.value(); - QVariant widgetValue(fixup(widget, property(widget))); - QVariant configValue(fixup(widget, config->property())); - if (!variantFuzzyCompare(widgetValue, configValue)) { - return true; - } - } - return false; -} diff --git a/kcms/touchpad/kcm/xlib/customconfigdialogmanager.h b/kcms/touchpad/kcm/xlib/customconfigdialogmanager.h deleted file mode 100644 index 1a715821e2..0000000000 --- a/kcms/touchpad/kcm/xlib/customconfigdialogmanager.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include -#include - -#include - -class CustomConfigDialogManager : public KConfigDialogManager -{ - Q_OBJECT -public: - CustomConfigDialogManager(QWidget *parent, KCoreConfigSkeleton *config, const QStringList &supported); - ~CustomConfigDialogManager(); - - QVariantHash currentWidgetProperties() const; - void setWidgetProperties(const QVariantHash &); - bool compareWidgetProperties(const QVariantHash &) const; - bool hasChangedFuzzy() const; - -private: - QVariant fixup(QWidget *widget, QVariant value) const; - - QMap m_widgets; - KCoreConfigSkeleton *m_config; -}; diff --git a/kcms/touchpad/kcm/xlib/customslider.cpp b/kcms/touchpad/kcm/xlib/customslider.cpp deleted file mode 100644 index 6b1707fd41..0000000000 --- a/kcms/touchpad/kcm/xlib/customslider.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "customslider.h" - -#include - -#include - -CustomSlider::Interpolator::~Interpolator() -{ -} - -double CustomSlider::Interpolator::absolute(double relative, double minimum, double maximum) const -{ - return relative * (maximum - minimum) + minimum; -} - -double CustomSlider::Interpolator::relative(double absolute, double minimum, double maximum) const -{ - return (absolute - minimum) / (maximum - minimum); -} - -double CustomSlider::SqrtInterpolator::absolute(double relative, double minimum, double maximum) const -{ - relative *= relative; - return Interpolator::absolute(relative, minimum, maximum); -} - -double CustomSlider::SqrtInterpolator::relative(double absolute, double minimum, double maximum) const -{ - double value = Interpolator::relative(absolute, minimum, maximum); - return std::sqrt(value); -} - -const CustomSlider::Interpolator CustomSlider::lerp; - -CustomSlider::CustomSlider(QWidget *parent) - : QSlider(parent) - , m_min(0.0) - , m_max(1.0) - , m_interpolator(&lerp) -{ - setSingleStep(10); - setPageStep(100); - - updateValue(); - updateRange(size()); - - connect(this, &QAbstractSlider::actionTriggered, this, &CustomSlider::updateValue); -} - -void CustomSlider::resizeEvent(QResizeEvent *e) -{ - QSlider::resizeEvent(e); - updateRange(e->size()); -} - -const CustomSlider::Interpolator *CustomSlider::interpolator() const -{ - return m_interpolator; -} - -void CustomSlider::setInterpolator(const CustomSlider::Interpolator *v) -{ - m_interpolator = v; -} - -void CustomSlider::setDoubleMinimum(double v) -{ - m_min = v; -} - -double CustomSlider::doubleMinimum() const -{ - return m_min; -} - -void CustomSlider::setDoubleMaximum(double v) -{ - m_max = v; -} - -double CustomSlider::doubleMaximum() const -{ - return m_max; -} - -double CustomSlider::doubleValue() const -{ - return qBound(m_min, m_value, m_max); -} - -void CustomSlider::setDoubleValue(double v) -{ - if (m_value == v) { - return; - } - - m_value = v; - int oldIntValue = value(); - moveSlider(); - if (value() != oldIntValue) { - Q_EMIT valueChanged(doubleValue()); - } -} - -double CustomSlider::intToDouble(int v) const -{ - double relative = lerp.relative(v, minimum(), maximum()); - return m_interpolator->absolute(relative, m_min, m_max); -} - -void CustomSlider::updateValue() -{ - m_value = intToDouble(sliderPosition()); - Q_EMIT valueChanged(doubleValue()); -} - -double CustomSlider::fixup(double v) const -{ - return intToDouble(doubleToInt(v)); -} - -int CustomSlider::doubleToInt(double v) const -{ - double relative = m_interpolator->relative(v, m_min, m_max); - double absolute = lerp.absolute(relative, minimum(), maximum()); - return static_cast(std::floor(absolute + 0.5)); -} - -void CustomSlider::moveSlider() -{ - setValue(doubleToInt(doubleValue())); -} - -void CustomSlider::updateRange(const QSize &s) -{ - setRange(0, (orientation() == Qt::Horizontal) ? s.width() : s.height()); - moveSlider(); -} diff --git a/kcms/touchpad/kcm/xlib/customslider.h b/kcms/touchpad/kcm/xlib/customslider.h deleted file mode 100644 index 60e65fd3af..0000000000 --- a/kcms/touchpad/kcm/xlib/customslider.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include - -class CustomSlider : public QSlider -{ - Q_OBJECT - - Q_PROPERTY(double minimum READ doubleMinimum WRITE setDoubleMinimum) - Q_PROPERTY(double maximum READ doubleMaximum WRITE setDoubleMaximum) - Q_PROPERTY(double value READ doubleValue WRITE setDoubleValue NOTIFY valueChanged USER true) - -public: - explicit CustomSlider(QWidget *parent = nullptr); - - void setDoubleMinimum(double); - double doubleMinimum() const; - - void setDoubleMaximum(double); - double doubleMaximum() const; - - class Interpolator - { - public: - Interpolator() - { - } - virtual double absolute(double relative, double minimum, double maximum) const; - virtual double relative(double absolute, double minimum, double maximum) const; - - virtual ~Interpolator(); - }; - - class SqrtInterpolator : public Interpolator - { - public: - SqrtInterpolator() - { - } - double absolute(double relative, double minimum, double maximum) const override; - double relative(double absolute, double minimum, double maximum) const override; - }; - - const Interpolator *interpolator() const; - void setInterpolator(const Interpolator *); - - double doubleValue() const; - double fixup(double) const; - -public Q_SLOTS: - void setDoubleValue(double); - -Q_SIGNALS: - void valueChanged(double); - -protected: - void resizeEvent(QResizeEvent *) override; - -private Q_SLOTS: - void updateValue(); - -private: - void updateRange(const QSize &); - void moveSlider(); - int doubleToInt(double) const; - double intToDouble(int) const; - - static const Interpolator lerp; - - double m_min, m_max, m_value; - const Interpolator *m_interpolator; -}; diff --git a/kcms/touchpad/kcm/xlib/sliderpair.cpp b/kcms/touchpad/kcm/xlib/sliderpair.cpp deleted file mode 100644 index 189fc38828..0000000000 --- a/kcms/touchpad/kcm/xlib/sliderpair.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "sliderpair.h" - -#include - -SliderPair::SliderPair(QSlider *minSlider, QSlider *maxSlider, QObject *parent) - : QObject(parent) - , m_minSlider(minSlider) - , m_maxSlider(maxSlider) -{ - connect(m_minSlider, &QAbstractSlider::valueChanged, this, &SliderPair::adjustMaxSlider); - connect(m_maxSlider, &QAbstractSlider::valueChanged, this, &SliderPair::adjustMinSlider); -} - -void SliderPair::adjustMaxSlider() -{ - m_maxSlider->setValue(qMax(m_maxSlider->value(), m_minSlider->value())); -} - -void SliderPair::adjustMinSlider() -{ - m_minSlider->setValue(qMin(m_maxSlider->value(), m_minSlider->value())); -} diff --git a/kcms/touchpad/kcm/xlib/sliderpair.h b/kcms/touchpad/kcm/xlib/sliderpair.h deleted file mode 100644 index aa764c7e64..0000000000 --- a/kcms/touchpad/kcm/xlib/sliderpair.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include - -class QSlider; - -class SliderPair : public QObject -{ - Q_OBJECT -public: - SliderPair(QSlider *minSlider, QSlider *maxSlider, QObject *parent = nullptr); - -private Q_SLOTS: - void adjustMinSlider(); - void adjustMaxSlider(); - -private: - QSlider *m_minSlider, *m_maxSlider; -}; diff --git a/kcms/touchpad/kcm/xlib/testarea.cpp b/kcms/touchpad/kcm/xlib/testarea.cpp deleted file mode 100644 index a9cd12bc7d..0000000000 --- a/kcms/touchpad/kcm/xlib/testarea.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "testarea.h" - -#include -#include - -#include -#include - -TestArea::TestArea(QWidget *parent) - : QWidget(parent) -{ - m_ui.setupUi(this); - - m_ui.listWidget->addItem(new QListWidgetItem(QIcon::fromTheme("folder"), i18n("Drag me"), m_ui.listWidget)); - - Plasma::Theme defaultTheme; - QString wallpaper = defaultTheme.wallpaperPath(); - static const QString stylesheet("background-image: url(%1)"); - m_ui.scrollAreaWidgetContents->setStyleSheet(stylesheet.arg(wallpaper)); -} - -void TestArea::enterEvent(QEnterEvent *e) -{ - Q_EMIT enter(); - QWidget::enterEvent(e); -} - -void TestArea::leaveEvent(QEvent *e) -{ - Q_EMIT leave(); - QWidget::leaveEvent(e); -} diff --git a/kcms/touchpad/kcm/xlib/testarea.h b/kcms/touchpad/kcm/xlib/testarea.h deleted file mode 100644 index cd50890697..0000000000 --- a/kcms/touchpad/kcm/xlib/testarea.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include "ui_testarea.h" - -class TestArea : public QWidget -{ - Q_OBJECT -public: - explicit TestArea(QWidget *); - -Q_SIGNALS: - void enter(); - void leave(); - -protected: - void enterEvent(QEnterEvent *) override; - void leaveEvent(QEvent *) override; - -private: - Ui::TestArea m_ui; -}; diff --git a/kcms/touchpad/kcm/xlib/testbutton.cpp b/kcms/touchpad/kcm/xlib/testbutton.cpp deleted file mode 100644 index 7b3c55859d..0000000000 --- a/kcms/touchpad/kcm/xlib/testbutton.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "testbutton.h" - -#include -#include - -#include - -TestButton::TestButton(QWidget *parent) - : QPushButton(parent) - , m_firstClick(true) -{ -} - -void TestButton::mousePressEvent(QMouseEvent *e) -{ - if (m_firstClick) { - m_originalText = text(); - m_firstClick = false; - } - - switch (e->button()) { - case Qt::LeftButton: - setText(i18nc("Mouse button", "Left button")); - break; - case Qt::RightButton: - setText(i18nc("Mouse button", "Right button")); - break; - case Qt::MiddleButton: - setText(i18nc("Mouse button", "Middle button")); - break; - default: - break; - } - - QTimer::singleShot(500, this, &TestButton::resetText); - - QPushButton::mousePressEvent(e); -} - -void TestButton::resetText() -{ - setText(m_originalText); -} diff --git a/kcms/touchpad/kcm/xlib/testbutton.h b/kcms/touchpad/kcm/xlib/testbutton.h deleted file mode 100644 index f6cba1edc8..0000000000 --- a/kcms/touchpad/kcm/xlib/testbutton.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include - -class TestButton : public QPushButton -{ - Q_OBJECT - -public: - explicit TestButton(QWidget *); - -protected: - void mousePressEvent(QMouseEvent *) override; - -private Q_SLOTS: - void resetText(); - -private: - QString m_originalText; - bool m_firstClick; -}; diff --git a/kcms/touchpad/kcm/xlib/touchpadconfigxlib.cpp b/kcms/touchpad/kcm/xlib/touchpadconfigxlib.cpp deleted file mode 100644 index dbcd412ba2..0000000000 --- a/kcms/touchpad/kcm/xlib/touchpadconfigxlib.cpp +++ /dev/null @@ -1,333 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "touchpadconfigxlib.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../touchpadconfigcontainer.h" -#include "actions.h" -#include "customconfigdialogmanager.h" -#include "customslider.h" -#include "sliderpair.h" -#include "touchpadbackend.h" -#include "touchpadinterface.h" - -#include "plasma_version.h" - -void TouchpadConfigXlib::kcmInit() -{ - TouchpadParameters::setSystemDefaults(); - touchpadApplySavedConfig(); -} - -static void copyHelpFromBuddy(QObject *root) -{ - QLabel *asLabel = qobject_cast(root); - if (asLabel && asLabel->buddy()) { - if (asLabel->toolTip().isEmpty()) { - asLabel->setToolTip(asLabel->buddy()->toolTip()); - } - if (asLabel->statusTip().isEmpty()) { - asLabel->setStatusTip(asLabel->buddy()->statusTip()); - } - if (asLabel->whatsThis().isEmpty()) { - asLabel->setWhatsThis(asLabel->buddy()->whatsThis()); - } - } - const auto childList = root->children(); - for (QObject *child : childList) { - copyHelpFromBuddy(child); - } -} - -template -QWidget *addTab(QTabWidget *tabs, T &form) -{ - QScrollArea *container = new QScrollArea(tabs); - container->setWidgetResizable(true); - container->setFrameStyle(QFrame::NoFrame); - container->setAlignment(Qt::AlignHCenter | Qt::AlignTop); - - QWidget *widget = new QWidget(container); - form.setupUi(widget); - copyHelpFromBuddy(widget); - widget->setContentsMargins(20, 20, 20, 20); - widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - - container->setWidget(widget); - tabs->addTab(container, widget->windowTitle()); - - return widget; -} - -TouchpadConfigXlib::TouchpadConfigXlib(TouchpadConfigContainer *parent, TouchpadBackend *backend) - : TouchpadConfigPlugin(parent, backend) - , m_configOutOfSync(false) -{ - QGridLayout *layout = new QGridLayout(this); - QVBoxLayout *messageLayout = new QVBoxLayout(); - layout->addLayout(messageLayout, 0, 0, 1, 2); - - // Messages - - m_errorMessage = new KMessageWidget(this); - m_errorMessage->setMessageType(KMessageWidget::Error); - m_errorMessage->setVisible(false); - m_errorMessage->setWordWrap(true); - messageLayout->addWidget(m_errorMessage); - - m_configOutOfSyncMessage = new KMessageWidget(this); - m_configOutOfSyncMessage->setMessageType(KMessageWidget::Warning); - m_configOutOfSyncMessage->setText( - i18n("Active settings don't match saved settings.\n" - "You currently see saved settings.")); - m_configOutOfSyncMessage->setVisible(false); - messageLayout->addWidget(m_configOutOfSyncMessage); - - m_loadActiveConfiguration = new QAction(m_configOutOfSyncMessage); - m_loadActiveConfiguration->setText(i18n("Show active settings")); - connect(m_loadActiveConfiguration, SIGNAL(triggered()), SLOT(loadActiveConfig())); - m_configOutOfSyncMessage->addAction(m_loadActiveConfiguration); - - layout->setColumnStretch(0, 3); - layout->setColumnStretch(1, 1); - - // Main UI - - m_tabs = new QTabWidget(this); - layout->addWidget(m_tabs, 1, 0, 1, 1); - - addTab(m_tabs, m_tapping); - addTab(m_tabs, m_scrolling); - addTab(m_tabs, m_pointerMotion); - addTab(m_tabs, m_sensitivity); - - static const CustomSlider::SqrtInterpolator interpolator; - m_pointerMotion.kcfg_MinSpeed->setInterpolator(&interpolator); - m_pointerMotion.kcfg_MaxSpeed->setInterpolator(&interpolator); - m_pointerMotion.kcfg_AccelFactor->setInterpolator(&interpolator); - - new SliderPair(m_pointerMotion.kcfg_MinSpeed, m_pointerMotion.kcfg_MaxSpeed, this); - new SliderPair(m_sensitivity.kcfg_FingerLow, m_sensitivity.kcfg_FingerHigh, this); - new SliderPair(m_pointerMotion.kcfg_PressureMotionMinZ, m_pointerMotion.kcfg_PressureMotionMaxZ, this); - - m_manager = new CustomConfigDialogManager(this, &m_config, m_backend->supportedParameters()); - connect(m_manager, SIGNAL(widgetModified()), SLOT(checkChanges()), Qt::QueuedConnection); - - // KDED settings - - m_kdedTab = addTab(m_tabs, m_kded); - m_daemonConfigManager = m_parent->addConfig(&m_daemonSettings, m_kdedTab); - - KMessageWidget *kdedMessage = new KMessageWidget(m_kdedTab); - kdedMessage->setMessageType(KMessageWidget::Information); - kdedMessage->setCloseButtonVisible(false); - kdedMessage->setText(i18n("These settings won't take effect in the testing area")); - qobject_cast(m_kdedTab->layout())->insertWidget(0, kdedMessage); - - connect(m_kded.configureNotificationsButton, SIGNAL(clicked()), SLOT(showConfigureNotificationsDialog())); - m_shortcutsDialog.reset(new KShortcutsDialog(KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed)); - m_shortcutsDialog->addCollection(new TouchpadGlobalActions(true, this), i18n("Enable/Disable Touchpad")); - connect(m_kded.configureShortcutsButton, &QPushButton::clicked, this, [this]() { - m_shortcutsDialog->configure(true); - }); - - m_mouseCombo = new KComboBox(true, m_kded.kcfg_MouseBlacklist); - m_kded.kcfg_MouseBlacklist->setCustomEditor(m_mouseCombo); - connect(m_backend, SIGNAL(mousesChanged()), SLOT(updateMouseList())); - m_backend->watchForEvents(false); - updateMouseList(); - - m_daemon = new OrgKdeTouchpadInterface("org.kde.kded6", "/modules/kded_touchpad", QDBusConnection::sessionBus(), this); - m_kdedTab->setEnabled(false); - QDBusPendingCallWatcher *watch; - watch = new QDBusPendingCallWatcher(m_daemon->workingTouchpadFound(), this); - // clang-format off - connect(watch, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(gotReplyFromDaemon(QDBusPendingCallWatcher*))); - // clang-format on - - // Testing area - - m_testArea = new TestArea(this); - layout->addWidget(m_testArea, 1, 1); - connect(m_testArea, SIGNAL(enter()), SLOT(beginTesting())); - connect(m_testArea, SIGNAL(leave()), SLOT(endTesting())); - connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(updateTestAreaEnabled())); - updateTestAreaEnabled(); -} - -void TouchpadConfigXlib::gotReplyFromDaemon(QDBusPendingCallWatcher *watch) -{ - QDBusPendingReply reply = *watch; - if (reply.isValid() && reply.value()) { - m_kdedTab->setEnabled(true); - } - watch->deleteLater(); -} - -void TouchpadConfigXlib::updateMouseList() -{ - const QStringList mouses(m_backend->listMouses(m_daemonSettings.mouseBlacklist())); - - for (int i = 0; i < m_mouseCombo->count();) { - if (!mouses.contains(m_mouseCombo->itemText(i))) { - m_mouseCombo->removeItem(i); - } else { - i++; - } - } - - for (const QString &device : mouses) { - if (!m_mouseCombo->contains(device)) { - m_mouseCombo->addItem(device); - } - } -} - -QVariantHash TouchpadConfigXlib::getActiveConfig() -{ - if (m_prevConfig) { - return *m_prevConfig; - } - - QVariantHash activeConfig; - if (!m_backend->getConfig(activeConfig)) { - m_errorMessage->setText(m_backend->errorString()); - QMetaObject::invokeMethod(m_errorMessage, "animatedShow", Qt::QueuedConnection); - } - return activeConfig; -} - -void TouchpadConfigXlib::loadActiveConfig() -{ - m_manager->setWidgetProperties(getActiveConfig()); - m_configOutOfSync = false; - m_configOutOfSyncMessage->animatedHide(); -} - -void TouchpadConfigXlib::load() -{ - m_manager->updateWidgets(); - - m_parent->kcmLoad(); - - m_configOutOfSync = !m_manager->compareWidgetProperties(getActiveConfig()); -} - -void TouchpadConfigXlib::save() -{ - m_manager->updateSettings(); - - m_configOutOfSync = false; - m_configOutOfSyncMessage->animatedHide(); - - bool daemonSettingsChanged = m_daemonConfigManager->hasChanged(); - - m_parent->kcmSave(); - - if (m_backend->applyConfig(m_config.values())) { - m_errorMessage->animatedHide(); - } else { - m_errorMessage->setText(m_backend->errorString()); - m_errorMessage->animatedShow(); - } - - if (daemonSettingsChanged) { - m_daemon->reloadSettings(); - updateMouseList(); - } -} - -void TouchpadConfigXlib::defaults() -{ - m_manager->updateWidgetsDefault(); - - m_parent->kcmDefaults(); -} - -void TouchpadConfigXlib::checkChanges() -{ - if (!m_backend->touchpadCount()) { - return; - } - m_parent->unmanagedWidgetChangeState(m_manager->hasChangedFuzzy() || m_configOutOfSync); - if (m_configOutOfSync) { - m_configOutOfSyncMessage->animatedShow(); - } else { - m_configOutOfSyncMessage->animatedHide(); - } -} - -void TouchpadConfigXlib::hideEvent(QHideEvent *e) -{ - Q_UNUSED(e); - endTesting(); -} - -TouchpadConfigXlib::~TouchpadConfigXlib() -{ - endTesting(); -} - -void TouchpadConfigXlib::onChanged() -{ - if (m_testArea->underMouse()) { - beginTesting(); - } -} - -void TouchpadConfigXlib::beginTesting() -{ - if (!m_prevConfig) { - m_prevConfig.reset(new QVariantHash()); - m_backend->getConfig(*m_prevConfig.get()); - } - m_backend->applyConfig(m_manager->currentWidgetProperties()); -} - -void TouchpadConfigXlib::endTesting() -{ - if (!m_prevConfig) { - return; - } - m_backend->applyConfig(*m_prevConfig.get()); - m_prevConfig.reset(); -} - -void TouchpadConfigXlib::updateTestAreaEnabled() -{ - bool enable = true; - for (QWidget *i = m_kdedTab; i; i = i->parentWidget()) { - if (i == m_tabs->currentWidget()) { - enable = false; - break; - } - } - - m_testArea->setEnabled(enable); - m_testArea->setMouseTracking(enable); - if (!enable) { - endTesting(); - } -} - -void TouchpadConfigXlib::showConfigureNotificationsDialog() -{ - KNotifyConfigWidget *widget = KNotifyConfigWidget::configure(nullptr, QStringLiteral("kcm_touchpad")); - QDialog *dialog = qobject_cast(widget->topLevelWidget()); - connect(dialog, SIGNAL(finished()), dialog, SLOT(deleteLater())); -} diff --git a/kcms/touchpad/kcm/xlib/touchpadconfigxlib.h b/kcms/touchpad/kcm/xlib/touchpadconfigxlib.h deleted file mode 100644 index f0d3df6fa5..0000000000 --- a/kcms/touchpad/kcm/xlib/touchpadconfigxlib.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#pragma once - -#include "../touchpadconfigplugin.h" - -#include -#include - -#include "kdedsettings.h" -#include "testarea.h" -#include "touchpadparameters.h" - -#include "ui_kded.h" -#include "ui_pointermotion.h" -#include "ui_scroll.h" -#include "ui_sensitivity.h" -#include "ui_tap.h" - -class TouchpadConfigContainer; -class TouchpadBackend; -class KMessageWidget; -class OrgKdeTouchpadInterface; -class CustomConfigDialogManager; -class QAction; -class KShortcutsDialog; -class QTabWidget; -class KComboBox; -class QDBusPendingCallWatcher; -class QHideEvent; - -class TouchpadConfigXlib : public TouchpadConfigPlugin -{ - Q_OBJECT - -public: - explicit TouchpadConfigXlib(TouchpadConfigContainer *parent, TouchpadBackend *backend); - ~TouchpadConfigXlib() override; - - static void kcmInit(); - - void load() override; - void save() override; - void defaults() override; - - void hideEvent(QHideEvent *) override; - -private Q_SLOTS: - void beginTesting(); - void endTesting(); - void onChanged(); - void checkChanges(); - void loadActiveConfig(); - void updateTestAreaEnabled(); - void updateMouseList(); - void showConfigureNotificationsDialog(); - void gotReplyFromDaemon(QDBusPendingCallWatcher *); - -private: - QVariantHash getActiveConfig(); - - TouchpadParameters m_config; - - std::unique_ptr m_prevConfig; - CustomConfigDialogManager *m_manager; - TouchpadDisablerSettings m_daemonSettings; - KConfigDialogManager *m_daemonConfigManager; - KMessageWidget *m_errorMessage, *m_configOutOfSyncMessage; - TestArea *m_testArea; - OrgKdeTouchpadInterface *m_daemon; - QAction *m_loadActiveConfiguration; - bool m_configOutOfSync; - std::unique_ptr m_shortcutsDialog; - QWidget *m_kdedTab; - QTabWidget *m_tabs; - KComboBox *m_mouseCombo; - - Ui::PointerMotionForm m_pointerMotion; - Ui::TapForm m_tapping; - Ui::ScrollForm m_scrolling; - Ui::SensitivityForm m_sensitivity; - Ui::KdedForm m_kded; -}; diff --git a/kcms/touchpad/kcm/xlib/ui/kded.ui b/kcms/touchpad/kcm/xlib/ui/kded.ui deleted file mode 100644 index bbd8c5b347..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/kded.ui +++ /dev/null @@ -1,201 +0,0 @@ - - - KdedForm - - - - 0 - 0 - 486 - 351 - - - - Enable/Disable Touchpad - - - - - - - 0 - 0 - - - - - - - - 0 - 0 - - - - Configure… - - - - - - - - - - - - Keyboard shortcuts: - - - configureShortcutsButton - - - - - - - - - - Disable touchpad when typing - - - true - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Timeout: - - - kcfg_KeyboardActivityTimeoutMs - - - - - - - If there was no keyboard activity for more than specified -number of milliseconds, touchpad will be enabled again - - - 0 - - - 99 - - - 10 - - - ms - - - - - - - Disable click emulation and scrolling. -You will be still able to move pointer using touchpad and perform clicks with hardware buttons. - - - Disable taps and scrolling only - - - - - - - - - - Disable touchpad when mouse is plugged in - - - true - - - true - - - - - - Qt::AlignHCenter|Qt::AlignTop - - - - - Notifications: - - - configureNotificationsButton - - - - - - - Configure… - - - - - - - - - - - - Ignored devices: - - - kcfg_MouseBlacklist - - - - - - - Some devices might be incorrectly treated as a mouse. -You can add them to this list so that they will be ignored when they're plugged in. - - - KEditListWidget::Add|KEditListWidget::Remove - - - - - - - - - - - KEditListWidget - QGroupBox -
keditlistwidget.h
-
- - QSpinBox - QWidget - -
- - configureShortcutsButton - kcfg_DisableOnKeyboardActivity - kcfg_KeyboardActivityTimeoutMs - kcfg_OnlyDisableTapAndScrollOnKeyboardActivity - kcfg_DisableWhenMousePluggedIn - - - -
diff --git a/kcms/touchpad/kcm/xlib/ui/pointermotion.ui b/kcms/touchpad/kcm/xlib/ui/pointermotion.ui deleted file mode 100644 index 33de3f353c..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/pointermotion.ui +++ /dev/null @@ -1,288 +0,0 @@ - - - PointerMotionForm - - - - 0 - 0 - 400 - 407 - - - - Pointer Motion - - - - - - Speed - - - true - - - - - - Minimum: - - - kcfg_MinSpeed - - - - - - - Minimum pointer speed - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Maximum: - - - kcfg_MaxSpeed - - - - - - - Maximum pointer speed - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Acceleration: - - - kcfg_AccelFactor - - - - - - - Acceleration factor for normal pointer movements - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - - - - Pressure-Dependent Motion - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Minimum pressure: - - - kcfg_PressureMotionMinZ - - - - - - - Minimum factor: - - - kcfg_PressureMotionMinFactor - - - - - - - Maximum pressure: - - - kcfg_PressureMotionMaxZ - - - - - - - Maximum factor: - - - kcfg_PressureMotionMaxFactor - - - - - - - Finger pressure at which minimum pressure motion factor is applied - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Finger pressure at which maximum pressure motion factor is applied - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Lowest setting for pressure motion factor - - - x - - - - - - - Greatest setting for pressure motion factor - - - x - - - - - - - - - - Noise Cancellation - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Vertical: - - - kcfg_VertHysteresis - - - - - - - Horizontal: - - - kcfg_HorizHysteresis - - - - - - - The minimum vertical hardware distance required to generate motion events - - - 0 - - - 10 - - - units - - - - - - - The minimum horizontal hardware distance required to generate motion events - - - 0 - - - 10 - - - units - - - - - - - - - - - CustomSlider - QSlider -
kcm/xlib/customslider.h
-
-
- - kcfg_MinSpeed - kcfg_MaxSpeed - kcfg_AccelFactor - kcfg_PressureMotionMinZ - kcfg_PressureMotionMinFactor - kcfg_PressureMotionMaxZ - kcfg_PressureMotionMaxFactor - kcfg_VertHysteresis - kcfg_HorizHysteresis - - - -
diff --git a/kcms/touchpad/kcm/xlib/ui/scroll.ui b/kcms/touchpad/kcm/xlib/ui/scroll.ui deleted file mode 100644 index 0916ee7105..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/scroll.ui +++ /dev/null @@ -1,393 +0,0 @@ - - - ScrollForm - - - - 0 - 0 - 610 - 503 - - - - Scrolling - - - - - - QFormLayout::FieldsStayAtSizeHint - - - Qt::AlignHCenter|Qt::AlignTop - - - - - Edge scrolling: - - - kcfg_VertEdgeScroll - - - - - - - Enable vertical scrolling when dragging along the right edge - - - Vertical - - - - - - - Enable horizontal scrolling when dragging along the bottom edge - - - Horizontal - - - - - - - Enable vertical scrolling when dragging with two fingers anywhere on the touchpad - - - Vertical - - - - - - - Enable horizontal scrolling when dragging with two fingers anywhere on the touchpad - - - Horizontal - - - - - - - Reverse vertical scrolling - - - Vertical - - - - - - - Reverse horizontal scrolling - - - Horizontal - - - - - - - Two-finger scrolling: - - - kcfg_VertTwoFingerScroll - - - - - - - Reverse scrolling: - - - kcfg_InvertVertScroll - - - - - - - - - - 300 - 0 - - - - Scrolling Distance - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Vertical: - - - kcfg_VertScrollDelta - - - - - - - Move distance of the finger for a scroll event - - - 1000.000000000000000 - - - 0.100000000000000 - - - mm - - - 1 - - - - - - - Horizontal: - - - kcfg_HorizScrollDelta - - - - - - - Move distance of the finger for a scroll event - - - 1000.000000000000000 - - - 0.100000000000000 - - - mm - - - 1 - - - - - - - - - - Continue scrolling after the finger is released from the edge of the touchpad - - - Coasting - - - true - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Minimum speed: - - - kcfg_CoastingSpeed - - - - - - - Your finger needs to produce this many scrolls per second in order to start coasting - - - 1.000000000000000 - - - scrolls/sec - - - - - - - Deceleration: - - - kcfg_CoastingFriction - - - - - - - Number of scrolls/second² to decrease the coasting speed - - - 1.000000000000000 - - - scrolls/sec² - - - - - - - Corner coasting: - - - kcfg_CornerCoasting - - - - - - - Enable edge scrolling to continue while the finger stays in an edge corner - - - Enable - - - - - - - - - - Scrolling is engaged when a drag starts in the given trigger region. -Moving your finger in clockwise circles around the center of the touchpad -will scroll down and counter clockwise motion will scroll up - - - Circular Scrolling - - - true - - - true - - - - QFormLayout::ExpandingFieldsGrow - - - - - Trigger region: - - - kcfg_CircScrollTrigger - - - - - - - Trigger region on the touchpad to start circular scrolling - - - - - - - Angle: - - - kcfg_CircScrollDelta - - - - - - - - 0 - 0 - - - - 45.000000000000000 - - - 0.100000000000000 - - - Move angle (degrees) of finger to generate a scroll event - - - ° - - - - - - - When used together with vertical scrolling, hitting the upper or lower right corner will seamlessly switch over from vertical to circular scrolling - - - true - - - - - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
-
- - kcfg_VertEdgeScroll - kcfg_HorizEdgeScroll - kcfg_VertTwoFingerScroll - kcfg_HorizTwoFingerScroll - kcfg_InvertVertScroll - kcfg_InvertHorizScroll - kcfg_VertScrollDelta - kcfg_HorizScrollDelta - kcfg_Coasting - kcfg_CoastingSpeed - kcfg_CoastingFriction - kcfg_CornerCoasting - kcfg_CircularScrolling - kcfg_CircScrollTrigger - kcfg_CircScrollDelta - - - -
diff --git a/kcms/touchpad/kcm/xlib/ui/sensitivity.ui b/kcms/touchpad/kcm/xlib/ui/sensitivity.ui deleted file mode 100644 index 253fad09a3..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/sensitivity.ui +++ /dev/null @@ -1,153 +0,0 @@ - - - SensitivityForm - - - - 0 - 0 - 430 - 210 - - - - Sensitivity - - - - - - Sensitivity - - - true - - - - - - Pressure for detecting a touch: - - - kcfg_FingerHigh - - - - - - - Pressure for detecting a release: - - - kcfg_FingerLow - - - - - - - When finger pressure goes above this value, the driver counts it as a touch - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - When finger pressure drops below this value, the driver counts it as a release - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - - - - If palm detection should be enabled. Note that this also requires hardware/firmware support from the touchpad - - - Palm Detection - - - true - - - true - - - - - - Minimum width: - - - kcfg_PalmMinWidth - - - - - - - Minimum pressure: - - - kcfg_PalmMinZ - - - - - - - Minimum finger width at which touch is considered a palm - - - 1 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Minimum finger pressure at which touch is considered a palm - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - - - - kcfg_FingerHigh - kcfg_FingerLow - kcfg_PalmDetect - kcfg_PalmMinWidth - kcfg_PalmMinZ - - - - diff --git a/kcms/touchpad/kcm/xlib/ui/tap.ui b/kcms/touchpad/kcm/xlib/ui/tap.ui deleted file mode 100644 index 47a80f8358..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/tap.ui +++ /dev/null @@ -1,500 +0,0 @@ - - - TapForm - - - - 0 - 0 - 516 - 531 - - - - Taps - - - - - - - - - 0 - 0 - - - - Tap to Click - - - true - - - true - - - - Qt::AlignHCenter|Qt::AlignTop - - - - - One finger: - - - kcfg_OneFingerTapButton - - - - - - - Which mouse button is reported on a non-corner one-finger tap - - - - - - - Two fingers: - - - kcfg_TwoFingerTapButton - - - - - - - Which mouse button is reported on a non-corner two-finger tap - - - - - - - Three fingers: - - - kcfg_ThreeFingerTapButton - - - - - - - Which mouse button is reported on a non-corner three-finger tap - - - - - - - - - - - - - - - 0 - 0 - - - - Corners - - - true - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Top left: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_LTCornerButton - - - - - - - Which mouse button is reported on a left top corner tap - - - - - - - Bottom left: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_LBCornerButton - - - - - - - Top right: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_RTCornerButton - - - - - - - Which mouse button is reported on a left bottom corner tap - - - - - - - Which mouse button is reported on a right top corner tap - - - - - - - Which mouse button is reported on a right bottom corner tap - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 30 - 20 - - - - - - - - Bottom right: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_RBCornerButton - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - - - - - - - This gesture is an alternative way of dragging. It is performed by tapping (touching and releasing the finger), then touching again and moving the finger on the touchpad - - - Tap-and-Drag Gesture - - - true - - - true - - - - - - If off, a tap-and-drag gesture ends when you release the finger. If on, the gesture is active until you tap a second time, or until timeout expires - - - Locked Drags - - - false - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Timeout: - - - kcfg_LockedDragTimeout - - - - - - - How long it takes (in milliseconds) for the "Locked Drags" mode to be automatically turned off after the finger is released from the touchpad - - - 0 - - - 99 - - - 99 - - - ms - - - - - - - - - - - - - - 300 - 0 - - - - Tap Detection - - - true - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - - - - Maximum time: - - - kcfg_MaxTapTime - - - - - - - - - - Maximum finger movement: - - - kcfg_MaxTapMove - - - - - - - - - - Maximum time for double tap: - - - kcfg_MaxDoubleTapTime - - - - - - - - - - Single tap timeout: - - - kcfg_SingleTapTimeout - - - - - - - Maximum time (in milliseconds) for detecting a tap - - - 0 - - - 99 - - - 10 - - - ms - - - - - - - Maximum movement of the finger for detecting a tap - - - 1000.000000000000000 - - - 0.100000000000000 - - - mm - - - 1 - - - - - - - Maximum time (in milliseconds) for detecting a double tap - - - 0 - - - 99 - - - 10 - - - ms - - - - - - - Timeout after a tap to recognize it as a single tap - - - 0 - - - 99 - - - 10 - - - ms - - - - - - - - - - - QSpinBox - QWidget - - - KComboBox - QComboBox -
kcombobox.h
-
- - QSpinBox - QWidget - -
- - kcfg_OneFingerTapButton - kcfg_TwoFingerTapButton - kcfg_ThreeFingerTapButton - kcfg_LTCornerButton - kcfg_RTCornerButton - kcfg_LBCornerButton - kcfg_RBCornerButton - kcfg_TapAndDragGesture - kcfg_LockedDrags - kcfg_LockedDragTimeout - kcfg_MaxTapTime - kcfg_MaxTapMove - kcfg_MaxDoubleTapTime - kcfg_SingleTapTimeout - - - -
diff --git a/kcms/touchpad/kcm/xlib/ui/testarea.ui b/kcms/touchpad/kcm/xlib/ui/testarea.ui deleted file mode 100644 index fe42a9b67b..0000000000 --- a/kcms/touchpad/kcm/xlib/ui/testarea.ui +++ /dev/null @@ -1,72 +0,0 @@ - - - TestArea - - - - 0 - 0 - 200 - 629 - - - - true - - - - - - Testing area - - - - - - Qt::NoFocus - - - Click me - - - - - - - Qt::NoFocus - - - - - 2000 - 2000 - - - - - - - - - Qt::NoFocus - - - QListView::IconMode - - - - - - - - - - - TestButton - QPushButton -
xlib/testbutton.h
-
-
- - -
diff --git a/kcms/touchpad/touchpadbackend.h b/kcms/touchpad/touchpadbackend.h index dc7e0ed199..6fbbd2ad45 100644 --- a/kcms/touchpad/touchpadbackend.h +++ b/kcms/touchpad/touchpadbackend.h @@ -20,7 +20,6 @@ enum class TouchpadInputBackendMode { #endif #if BUILD_KCM_TOUCHPAD_X11 XLibinput = 2, - XSynaptics = 3, #endif };