Alexander Mezinhttps://amezin.github.io//
Wed, 19 Aug 2015 13:18:54 +0000Wed, 19 Aug 2015 13:18:54 +0000Jekyll v2.4.0Pointing devices KCM: status report<p>For general information about the project, look at <a href="/kde/gsoc/2015/06/16/gsoc-intro.html">this post</a></p>
<p>I didn’t post any updates for a long time, mostly because I was coding actively, and completely forgot about anything else :)</p>
<p>First of all, new screenshots:</p>
<p><img src="/images/kcm-newlayout-mouse.png" alt="KCM - Mouse settings" /></p>
<p><img src="/images/kcm-newlayout-touchpad.png" alt="KCM - Touchpad settings" /></p>
<h1 id="current-status">Current status</h1>
<p>On X11:</p>
<ul>
<li>
<p>All properties of libinput driver can be configured from UI.</p>
</li>
<li>
<p>Incomplete UI for evdev and synaptics drivers.</p>
</li>
</ul>
<p>On Wayland:</p>
<ul>
<li>
<p>Works with patched KWin.</p>
</li>
<li>
<p>Uses the same UI as on X11 (libinput).</p>
</li>
</ul>
<h1 id="near-term-plans">Near-term plans</h1>
<ul>
<li>
<p>Refactoring.</p>
</li>
<li>
<p>Write more tests.</p>
</li>
<li>
<p>UI improvements for libinput - adjust layout, better names for some options, add tooltips.</p>
</li>
<li>
<p>Also, I’ll try to get rid of ‘Device’ combo box. It would be cool if every device is displayed as a separate KCM. However, currently I have no idea how to achieve it.</p>
</li>
</ul>
<h1 id="long-term-plans-post-gsoc">Long-term plans (post-GSoC)</h1>
<ul>
<li>
<p>Implement button mapping configuration on X11. It is necessary for evdev driver to enable left-handed mode, and isn’t available as XInput property.</p>
</li>
<li>
<p>Finish UI for evdev and synaptics.</p>
</li>
<li>
<p>Probably, I will port automatic disable logic from Touchpad KDED module. Only libinput has built-in automatic disable. However, as libinput becomes more widespread, there will be no need for custom implementation.</p>
</li>
</ul>
<h1 id="how-to-try">How to try</h1>
<ul>
<li>
<p>You can get the source from <code>git://anongit.kde.org/scratch/alexandermezin/pointing-devices-kcm.git</code></p>
</li>
<li>
<p>There is a <a href="https://aur.archlinux.org/packages/kcm-pointing-devices-git/">packaging script for Arch Linux in AUR</a></p>
</li>
</ul>
<p>Beware! It crashes with latest stable libxcb and xcb-proto. To make it work you will need xcb and xcb-proto from git.</p>
<h2 id="kwinwayland">Kwin/Wayland</h2>
<p>Wayland support isn’t enabled by default, and I doubt anybody wants to try it today :) But if you want, you need to:</p>
<ul>
<li>
<p>Build KWin from my repo: <code>git://anongit.kde.org/clones/kwin/alexandermezin/kwin.git</code> (branch libinput-dbusconfig).</p>
</li>
<li>
<p>Pass <code>-DBUILD_KWIN_BACKEND=ON</code> to cmake.</p>
</li>
</ul>
Wed, 12 Aug 2015 04:00:00 +0000https://amezin.github.io//kde/gsoc/2015/08/12/gsoc-update.html
https://amezin.github.io//kde/gsoc/2015/08/12/gsoc-update.htmlkdegsocPointing devices KCM: update #2<p>For general information about the project, look at <a href="/kde/gsoc/2015/06/16/gsoc-intro.html">this post</a></p>
<p>Originally I planned to work on the KCM UI at this time. But as I am unsure how it should look like, I started a <a href="https://forum.kde.org/viewtopic.php?f=285&amp;t=127056">discussion on VDG forum</a>, and decided to switch to other tasks.</p>
<p>Currently the KCM looks like this:</p>
<p><img src="/images/kcm.png" alt="KCM screenshot" /></p>
<p>Don’t worry, it isn’t the final UI, just a minimal demo :)</p>
<p>KDED module is, I think, almost complete. It can apply settings from configuration file, and has a method exported to D-Bus to reload configuration for all devices or for some specific device. Of course, it also applies settings immediately when device is plugged in. The only thing that is missing is auto-disabling of some devices (like disable touchpad when there’s an external mouse).</p>
<p>As usual, <a href="http://quickgit.kde.org/?p=scratch%2Falexandermezin%2Fpointing-devices-kcm.git">here is a link to the repository</a>.</p>
<p>Also, I started working on a D-Bus API for KWin. The API will expose most of libinput configuration settings. Currently it lists all available devices, some of their most important read-only properties (like name, hardware ids, capabilities), and allows to enable/disable tap-to-click as an example of writable property. As I already said, KCM isn’t yet ready, but I was able to enable tap-to-click on my touchpad using qdbusviewer.</p>
<p>My kwin repo clone <a href="http://quickgit.kde.org/?p=clones%2Fkwin%2Falexandermezin%2Fkwin.git">is here</a>, branch libinput-dbusconfig</p>
Thu, 02 Jul 2015 23:00:00 +0000https://amezin.github.io//kde/gsoc/2015/07/02/gsoc-update-2.html
https://amezin.github.io//kde/gsoc/2015/07/02/gsoc-update-2.htmlkdegsocPointing devices KCM: status update<p>For general information about the project, look at <a href="/kde/gsoc/2015/06/16/gsoc-intro.html">this post</a></p>
<p>Last week I was working mostly on architecture.</p>
<p>There will be 3 modules:</p>
<ul>
<li>A library that performs ‘dirty work’ of talking with X server/Wayland compositor</li>
<li>A daemon that applies settings on startup and when devices are plugged in</li>
<li>KCM</li>
</ul>
<h1 id="the-library">The library</h1>
<p>The library is partially implemented already.</p>
<p>For X11 the library consists of 3 layers:</p>
<ul>
<li>QObject wrapper for XInput (XInputDevice, XInputDeviceManager)</li>
<li>Adapters that map XInput objects to the common interface (XInputDeviceAdapter, XInputDeviceManagerAdapter)</li>
<li>Interface classes (InputDevice, InputDeviceManager)</li>
</ul>
<p>With code organized in such way it is clear how XInput properties are mapped to properties in the library interface, and the mapping code looks very simple.</p>
<p>For Wayland/KWin/libinput thigs are a bit more complex:</p>
<ul>
<li>There will be a module for KWin, that configures libinput inside KWin process</li>
<li>The module will have a D-Bus interface</li>
<li>There will be two D-Bus adapter classes, similar to adapters for XInput</li>
</ul>
<p>Currently I am working on X11 only. I’ll start adding Wayland support later, at least when I’ll get a working KCM on X11.</p>
<h1 id="the-daemon">The daemon</h1>
<p>The daemon will be a KDED module. The only function that the daemon will support is applying configuration from configuration file. Daemon will apply the configuration automatically when a device is plugged in, and there will be a D-Bus API to trigger it manually.</p>
<h1 id="kcm">KCM</h1>
<p>KCM will be, basically, an editor for daemon config. Currently I have a dummy KCM that only shows a list of available devices. I plan to add few configuration options in following days.</p>
<h1 id="overall-status">Overall status</h1>
<p>I’m still behind schedule, but, I think, I made big progress. The hardest part was getting QML KCM to work.</p>
<p>Kcmshell and systemsettings print misleading error message:</p>
<pre><code>Error loading plugin "kcm_pointingdevices" "The shared library was not found."
Plugin search paths are ("/usr/lib/qt/plugins", "/usr/bin")
</code></pre>
<p>However, the KCM loads correctly. I spend a lot of time trying to fix it, but looks like this message is printed as a part of normal execution, and doesn’t indicate any actual error.</p>
<p>As I’m starting to work on UI, I’d like to hear what you like/don’t like in current Touchpad KCM and Mouse KCM.</p>
<p>As usual, <a href="http://quickgit.kde.org/?p=scratch%2Falexandermezin%2Fpointing-devices-kcm.git">here is a link to the repository</a>.</p>
Fri, 26 Jun 2015 11:32:45 +0000https://amezin.github.io//kde/gsoc/2015/06/26/gsoc-update.html
https://amezin.github.io//kde/gsoc/2015/06/26/gsoc-update.htmlkdegsocQML compositing manager for X11<p>This post isn’t generally related to KDE. But, I think, it might be interesting to the community, especially to developers.</p>
<p>Once upon a time I looked at QtWayland module. QML compositor example, in particular. And decided to build something similar for X11. At first I tried to build a window manager, but the task was too complex. A standalone compositing manager looked like more realistic task.</p>
<p>So, <a href="https://github.com/amezin/qmlcompmgr">here is the result</a>.</p>
<p>It isn’t ready for daily use. It crashes from time to time. It has problems with performance because there’s almost no optimization. For example, it draws windows that are covered by other windows completely. But in some test cases it outperforms <a href="https://github.com/chjj/compton">Compton</a> (with glx backend), thanks to Qt Quick’s Scene Graph.</p>
<p>And here is a short video showing it in action (with Openbox):</p>
<video preload="metadata" controls="">
<source src="https://amezin.github.io//video/qmlcompmgr.webm" type="video/webm" />
<source src="https://amezin.github.io//video/qmlcompmgr.mp4" type="video/mp4" />
</video>
<p>Implemented effects:</p>
<ul>
<li>
<p>Window show/hide animation</p>
</li>
<li>
<p>Dim inactive windows (though it dims too many windows)</p>
</li>
<li>
<p>Shadows</p>
</li>
</ul>
<p>Known problems:</p>
<ul>
<li>
<p>Performance</p>
</li>
<li>
<p>Only properties of the ‘frame window’ are inspected. Fixing this will require major changes in source code</p>
</li>
<li>
<p>Once it crashed when about 300 windows was mapped in a short period of time</p>
</li>
</ul>
<p>UPD: re-uploaded video in multiple formats, now it should play fine in Chromium</p>
Sat, 20 Jun 2015 07:20:45 +0000https://amezin.github.io//2015/06/20/qmlcompmgr.html
https://amezin.github.io//2015/06/20/qmlcompmgr.htmlGSOC: new unified KCM for mouse and touchpad<p>This year I’m participating in Google Summer of Code with a project called “Pointing Devices KCM”. It is about creating new unified KCM for both mouses and touchpads (and maybe some other devices like ThinkPad’s pointing stick later).</p>
<p>Why new KCM?</p>
<ul>
<li>Mouse KCM and Touchpad KCM should have a lot of common code. Both of them change properties of XInput devices (a lot of code, actually). And touchpads and mouses have few common properties. Currently, every KCM implements things its own way.</li>
<li>Also, I think that Mouse and Touchpad KCMs should have similar UI. Both of them should have the “testing area”. Or both of them shouldn’t.</li>
<li>Current mouse KCM controls so-called “master pointer”. Changes in it actually affect all pointer devices, including touchpad. Of course, that’s not how it is expected to work.</li>
<li>None of these KCMs can handle multiple devices.</li>
<li>None of these KCMs can handle Wayland. I planned Wayland support for Touchpad KCM, but it seems that I did too many mistakes. It doesn’t look like Wayland support can be added to it easily.</li>
</ul>
<p>For me it looks like fixing all these problems in existing code will take a lot more time and effort than writing new KCM. And writing something new is always more fun :)</p>
<h1 id="current-status">Current status</h1>
<p>Unfortunately, graduating from university took a lot more time than I expected. So I was able to start coding this week only. But now I’ve finished almost everything and, hopefully, will be able to catch up my original schedule.</p>
<p>I heard Touchpad KCM code looked scary for people who reviewed it. Especially the XInput-related code. So as a first step I decided to implement a nice (to my taste) utility library. Currently it can handle XInput hierarchy and property notifications, enumerates devices and change their properties. There’s also few tests for it.</p>
<p>For now I’ll be keeping all my code in <a href="http://quickgit.kde.org/?p=scratch%2Falexandermezin%2Fpointing-devices-kcm.git">this scratch repo</a>.</p>
<p>UPD: Looks like xcb_input_xi_change_property is broken in current release of XCB. It triggers assert() for property values that have length not divisible by 4 (bytes). And even git version has this problem too. But there is a <a href="http://lists.freedesktop.org/archives/xcb/2015-June/010385.html">patch available on XCB mailing list</a> that fixes the problem.</p>
Tue, 16 Jun 2015 17:27:45 +0000https://amezin.github.io//kde/gsoc/2015/06/16/gsoc-intro.html
https://amezin.github.io//kde/gsoc/2015/06/16/gsoc-intro.htmlkdegsoc