Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kcm/touchpadconfigcontainer.cpp
Show All 14 Lines | |||||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "touchpadconfigcontainer.h" | 19 | #include "touchpadconfigcontainer.h" | ||
20 | #include "touchpadconfigplugin.h" | 20 | #include "touchpadconfigplugin.h" | ||
21 | #include "kcm/libinput/touchpadconfiglibinput.h" | 21 | #include "kcm/libinput/touchpadconfiglibinput.h" | ||
22 | #include "kcm/xlib/touchpadconfigxlib.h" | 22 | #include "kcm/xlib/touchpadconfigxlib.h" | ||
23 | #include "touchpadbackend.h" | ||||
23 | 24 | | |||
24 | #include <KWindowSystem/kwindowsystem.h> | 25 | #include <KWindowSystem/kwindowsystem.h> | ||
25 | 26 | | |||
26 | extern "C" | 27 | extern "C" | ||
27 | { | 28 | { | ||
28 | Q_DECL_EXPORT void kcminit_touchpad() | 29 | Q_DECL_EXPORT void kcminit_touchpad() | ||
29 | { | 30 | { | ||
30 | if (KWindowSystem::isPlatformX11()) { | 31 | if (KWindowSystem::isPlatformX11()) { | ||
31 | TouchpadConfigXlib::kcmInit(); | 32 | TouchpadConfigXlib::kcmInit(); | ||
32 | } | 33 | } | ||
33 | } | 34 | } | ||
34 | } | 35 | } | ||
35 | 36 | | |||
36 | TouchpadConfigContainer::TouchpadConfigContainer(QWidget *parent, const QVariantList &args) | 37 | TouchpadConfigContainer::TouchpadConfigContainer(QWidget *parent, const QVariantList &args) | ||
37 | : KCModule(parent, args) | 38 | : KCModule(parent, args) | ||
38 | { | 39 | { | ||
40 | TouchpadBackend *backend = TouchpadBackend::implementation(); | ||||
39 | if (KWindowSystem::isPlatformX11()) { | 41 | if (KWindowSystem::isPlatformX11()) { | ||
40 | m_plugin = new TouchpadConfigXlib(this); | 42 | if (backend->getMode() == TouchpadInputBackendMode::XLibinput) { | ||
43 | m_plugin = new TouchpadConfigLibinput(this, backend); | ||||
44 | } | ||||
45 | else if (backend->getMode() == TouchpadInputBackendMode::XSynaptics) { | ||||
46 | m_plugin = new TouchpadConfigXlib(this, backend); | ||||
47 | } | ||||
41 | } else if (KWindowSystem::isPlatformWayland()) { | 48 | } else if (KWindowSystem::isPlatformWayland()) { | ||
42 | m_plugin = new TouchpadConfigLibinput(this); | 49 | m_plugin = new TouchpadConfigLibinput(this, backend); | ||
43 | } | 50 | } | ||
44 | } | 51 | } | ||
45 | 52 | | |||
46 | QSize TouchpadConfigContainer::minimumSizeHint() const | 53 | QSize TouchpadConfigContainer::minimumSizeHint() const | ||
47 | { | 54 | { | ||
48 | return m_plugin->minimumSizeHint(); | 55 | return m_plugin->minimumSizeHint(); | ||
49 | } | 56 | } | ||
50 | QSize TouchpadConfigContainer::sizeHint() const | 57 | QSize TouchpadConfigContainer::sizeHint() const | ||
Show All 29 Lines |