[Differential] [Request, 2,415 lines] D3617: [Touchpad KCM] New KWin Wayland version

subdiff (Roman Gilg) noreply at phabricator.kde.org
Wed Dec 7 15:18:23 UTC 2016


subdiff created this revision.
subdiff added reviewers: KWin, Plasma on Wayland, Plasma.
subdiff added a subscriber: plasma-devel.
subdiff set the repository for this revision to R119 Plasma Desktop.
subdiff added a project: Plasma.
Restricted Application edited projects, added Plasma on Wayland, KWin; removed Plasma.
Restricted Application added a subscriber: kwin.

REVISION SUMMARY
  In order to work under KWin Wayland the Touchpad KCM needed to be adjusted. In theory this should have meant only the creation of an additional backend. But since a libinput based touchpad configuration utility needs to be in many ways different than the legacy X version the decision was made to redesign the user interface aswell.
  
  Feature summary:
  ----------------
  
  - Changes the configuration of each connected touchpad individually
  - Saves changes per device (through the KWin libinput backend) in a config file.
  - Quick switch between devices via drop-down list.
  - Loads and removes devices on the fly on hotplugging events and informs the user with animated messages.
  - Visual indication if a property is not supported by a device
  - Tooltips give additional informations about available options
  
  Technical overview:
  -------------------
  
  The KCModule was redesigned as a container, which loads on opening a X or Wayland plugin dependent on the active windowing system. In the X case it loads the legacy QWidget, which was untouched besides integration work in the new plugin structure. In the Wayland case, it loads the new QML based user interface, which was written from scratch.
  
  The user interface then instantiates appropriate backend. In the X case it loads the old backend, which was also not changed. The Wayland backend was created aswell from scratch.
  
  **Backend:**
  `KWinWaylandBackend` queries available devices from KWin via D-Bus and creates `KWinWaylandTouchpad` instances for each available touchpad.
  
  `KWinWaylandTouchpad` gets via D-Bus all properties from KWin, which are relevant for a touchpad and saves them in property structs. This includes: Boolean if the property is supported by the specific touchpad. Default and reset values for the generic KCModule actions. And the D-Bus name in order to write changes back later on
  
  When requested by the KCModule, the backend sends all changed values back to KWin, which then forwards them to libinput and saves them in its config file. The backend also connect to KWin signals over D-Bus, which emit in case a touchpad gets disconnected or another one additionally connected.
  
  **Frontend:**
  Loads the device list from the backend and all properties of the selected touchpad. If a value gets changed in the ui, it writes directly back to the `KWinWaylandTouchpad` instance.
  
  If there is no touchpad available an info message is shown and the control elements get disabled. If a touchpad is then connected, it is automatically loaded and the message vanishes. A similar message is shown when disconnecting the touchpad with currently opened configuration.
  
  **Requests for help / future work:**
  I need in particular feedback on my QML coding. I hope it's fine in general but there is most certainly stuff to be improved. Also the option and tooltip texts need someone else to take a look on.
  
  The touchpad in my laptop doesn't support "Scroll-on-Button-Down". Since I would've needed to test the functionality somehow while coding, I didn't implement it yet and only did some ground work.
  
  The hot plug handling seems a bit overengineered for touchpads, which are normally permanently installed. But most functionality of this KCM in general could be transferred to a new Wayland based Mouse KCM, which also could needs an overhaul. Maybe this could be a project for a just starting contributer, since it would involve different areas of Plasma/KWin while there is already a similar example with the Touchpad KCM.
  
  F673982: 001-cut.png <https://phabricator.kde.org/F673982>

TEST PLAN
  Manually tested with a single touchpad in my laptop. In order to test the hot plugging I changed the reply value in `KWinWaylandBackend` to also gather other pointer devices. This way I could test it with multiple mice over USB.

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D3617

AFFECTED FILES
  kcms/touchpad/src/CMakeLists.txt
  kcms/touchpad/src/backends/kwin_wayland.cmake
  kcms/touchpad/src/backends/kwin_wayland/kwinwaylandbackend.cpp
  kcms/touchpad/src/backends/kwin_wayland/kwinwaylandbackend.h
  kcms/touchpad/src/backends/kwin_wayland/kwinwaylandtouchpad.cpp
  kcms/touchpad/src/backends/kwin_wayland/kwinwaylandtouchpad.h
  kcms/touchpad/src/backends/x11/xlibbackend.h
  kcms/touchpad/src/kcm/customconfigdialogmanager.cpp
  kcms/touchpad/src/kcm/customconfigdialogmanager.h
  kcms/touchpad/src/kcm/customslider.cpp
  kcms/touchpad/src/kcm/customslider.h
  kcms/touchpad/src/kcm/libinput/components/ExclGroupBox.qml
  kcms/touchpad/src/kcm/libinput/components/ToolTip.qml
  kcms/touchpad/src/kcm/libinput/main.qml
  kcms/touchpad/src/kcm/libinput/touchpadconfiglibinput.cpp
  kcms/touchpad/src/kcm/libinput/touchpadconfiglibinput.h
  kcms/touchpad/src/kcm/resources.qrc
  kcms/touchpad/src/kcm/sliderpair.cpp
  kcms/touchpad/src/kcm/sliderpair.h
  kcms/touchpad/src/kcm/testarea.cpp
  kcms/touchpad/src/kcm/testarea.h
  kcms/touchpad/src/kcm/testbutton.cpp
  kcms/touchpad/src/kcm/testbutton.h
  kcms/touchpad/src/kcm/touchpad.kcfg
  kcms/touchpad/src/kcm/touchpadconfig.cpp
  kcms/touchpad/src/kcm/touchpadconfig.h
  kcms/touchpad/src/kcm/touchpadconfigcontainer.cpp
  kcms/touchpad/src/kcm/touchpadconfigcontainer.h
  kcms/touchpad/src/kcm/touchpadconfigplugin.cpp
  kcms/touchpad/src/kcm/touchpadconfigplugin.h
  kcms/touchpad/src/kcm/touchpadparameters.kcfgc
  kcms/touchpad/src/kcm/touchpadparametersbase.cpp
  kcms/touchpad/src/kcm/touchpadparametersbase.h
  kcms/touchpad/src/kcm/ui/kded.ui
  kcms/touchpad/src/kcm/ui/pointermotion.ui
  kcms/touchpad/src/kcm/ui/scroll.ui
  kcms/touchpad/src/kcm/ui/sensitivity.ui
  kcms/touchpad/src/kcm/ui/tap.ui
  kcms/touchpad/src/kcm/ui/testarea.ui
  kcms/touchpad/src/kcm/xlib/customconfigdialogmanager.cpp
  kcms/touchpad/src/kcm/xlib/customconfigdialogmanager.h
  kcms/touchpad/src/kcm/xlib/customslider.cpp
  kcms/touchpad/src/kcm/xlib/customslider.h
  kcms/touchpad/src/kcm/xlib/sliderpair.cpp
  kcms/touchpad/src/kcm/xlib/sliderpair.h
  kcms/touchpad/src/kcm/xlib/testarea.cpp
  kcms/touchpad/src/kcm/xlib/testarea.h
  kcms/touchpad/src/kcm/xlib/testbutton.cpp
  kcms/touchpad/src/kcm/xlib/testbutton.h
  kcms/touchpad/src/kcm/xlib/touchpad.kcfg
  kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp
  kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.h
  kcms/touchpad/src/kcm/xlib/touchpadparameters.kcfgc
  kcms/touchpad/src/kcm/xlib/touchpadparametersbase.cpp
  kcms/touchpad/src/kcm/xlib/touchpadparametersbase.h
  kcms/touchpad/src/kcm/xlib/ui/kded.ui
  kcms/touchpad/src/kcm/xlib/ui/pointermotion.ui
  kcms/touchpad/src/kcm/xlib/ui/scroll.ui
  kcms/touchpad/src/kcm/xlib/ui/sensitivity.ui
  kcms/touchpad/src/kcm/xlib/ui/tap.ui
  kcms/touchpad/src/kcm/xlib/ui/testarea.ui
  kcms/touchpad/src/logging.cpp
  kcms/touchpad/src/logging.h
  kcms/touchpad/src/plugins.cpp
  kcms/touchpad/src/touchpadbackend.cpp
  kcms/touchpad/src/touchpadbackend.h

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: subdiff, #kwin, #plasma_on_wayland, #plasma
Cc: kwin, plasma-devel, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161207/0400e4c2/attachment.html>


More information about the Plasma-devel mailing list