Touchpad gesture events via XInput2?

Peter Hutterer peter.hutterer at who-t.net
Wed Sep 11 03:42:05 UTC 2019


On Tue, Sep 10, 2019 at 09:51:47PM +0200, Michael Weiser wrote:
> Hello,
> 
> I've been looking into the current state of affairs regarding touchpad
> gestures such as swipe and pinch on Linux as an end user. Everybody
> wanting to support them seems to be talking to libinput directly, either
> necessitating the user having access to the input device nodes directly
> (e.g. libinput-gestures) or talking to systemd's logind, becoming its
> exclusive session controller and have it hand over open fds to those
> (e.g. mutter [and only on wayland?]).
> 
> The former raises security concerns and the latter seems like a lot of
> initial (logind) and followup (passing on events/access) work, quite
> constraining (only one session controller) and DE(desktop
> envionment)-specific to me (e.g. How does a KDE program see gestures
> when running in a Gnome session where mutter is (maybe) passing them as
> GTK signals?).
> 
> So I'm wondering: Are there any plans to deliver them as X events e.g.
> via XInput2 or any reasons why that would be a bad idea[tm]?
> 
> I've done a bit of hacking of xf86-input-libinput, xorgproto, libxi and
> xserver on a rainy afternoon and can now receive newly created swipe
> XInput2 events - admittedly without any coordinates because I've yet to
> understand the X server's valuator magic. Though it can obviously be
> done I'm just wondering if it'd be worthwile spending any more thought
> on.

The basic thing with touchpad gestures in XI2 is: you'll need to write XI
2.4 for it, i.e. all the bits that you mention. i.e. writing the specs,
figuring out the corner cases, updating everything, etc.

No-one has so far found the motivation to do this and that's the simple
reason it doesn't exist. It's generally code that no-one wants to touch
unless they have to.

There's going to be a lot more detail to it than it may seem on the surface
too, usually any attempts to add new input events come to a halt when it
comes to figuring out how grabs will work with those new events in a
backwards compatible manner.

But yeah, adding gestures to XI2 (or a new extension, but I'm not sure that
would make things easier) is the likely best option. Note that "best"
doesn't mean "easy" :)

Cheers,
   Peter


More information about the xorg mailing list