summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-12-07Use new xf86AddEnabledDeviceSerialized instead of AddEnabledDevice [v2]HEADmasterKeith Packard2-0/+20
This lets the xfree86 layer change to the NotifyFd interface without affecting the driver. v2: Check for new API in configure.ac and use only if present Signed-off-by: Keith Packard <keithp@keithp.com>
2015-11-23Split mixed pointer/keyboard devices into two separate X devicesPeter Hutterer1-59/+385
The server struggles with devices that are both, the protocol (especially XI2) requires a fairly strict separation of pointer vs keyboard devices. Though the server has a couple of hacks to route events correctly, mixed devices still experience bugs like [1]. Instead of advertising the device as a single mixed device, split the device into two X devices, one with only a pointer/touch component, one with only a keyboard component. This ensures that the device is effectively attached to both the VCP and the VCK, something the XI2 protocol doesn't really allow. This patch drops the keyboard capability on a mixed device, duplicates the input options and attributes and queues a NewInputDeviceRequest call. The new device only has the keyboard capability but is otherwise unchanged. The wacom driver has used this approach for years. The WorkProc is necessary to avoid inconsistent state, the server doesn't handle a NewInputDeviceRequest during PreInit well. The approach: During pre-init we create a struct xf86libinput_device with the libinput_device and a unique ID. The child device has that ID added to the options and will look for the other device during its pre-init. The two devices then share the xf86libinput_device struct. We only have a single epollfd for all devices and the server calls read_input on the first device in the list with the epollfd as pInfo->fd. That shared struct is used as the userdata on the libinput_device we get back from the event, and each device is in the xorg_list device_list of that shared struct. We loop through those to find the ones with the right capabilities and post the event through that device. Since devices can be enabled and disabled independently, the rest of the code makes sure that we only ever add the device to libinput when the first shared device is enabled, and remove it accordingly. The server uses pInfo->major/minor to detect if another device is using the same path for a logind-controlled fd. If so, it reuses that device's pInfo->fd and sets the "fd" option to that value. That pInfo->fd is the libinput epollfd though, not the actual device fd. This doesn't matter for us, since we manage the fds largely ourselves and the pInfo->fd we use is the epollfd anyway. On unplug however, the udev code triggers a device removal for all devices, including the duplicated ones. When we disable device, we restore the pInfo->fd from the "fd" option so that the server can request logind to close the fd. That only works if the "fd" option is correct, otherwise the server asks logind to close the epollfd and everyone is unhappy. [1] https://bugs.freedesktop.org/show_bug.cgi?id=49950 https://bugs.freedesktop.org/show_bug.cgi?id=92896 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-20Revert "Split mixed pointer/keyboard devices into two separate X devices"Peter Hutterer1-354/+59
When using logind, this causes the server to hang when a split device is unplugged. The reason is mostly in the server, when open the device by requesting the logind fd, the server loops through the device list to check if any other device has the same major/minor (see systemd_logind_take_fd()) and returns the pInfo->fd for that device instead of requesting the fd again from logind. For libinput devices, the pInfo->fd is the epollfd, not the actual device, so our second device gets the epollfd assigned. When the devices are removed, we keep the device fd open and release the epollfd through logind. This reverts commit c943739a2bfd4c380db0b21bc35b73deb7496c8a.
2015-11-20Split mixed pointer/keyboard devices into two separate X devicesPeter Hutterer1-59/+354
The server struggles with devices that are both, the protocol (especially XI2) requires a fairly strict separation of pointer vs keyboard devices. Though the server has a couple of hacks to route events correctly, mixed devices still experience bugs like [1]. Instead of advertising the device as a single mixed device, split the device into two X devices, one with only a pointer/touch component, one with only a keyboard component. This ensures that the device is effectively attached to both the VCP and the VCK, something the XI2 protocol doesn't really allow. This patch drops the keyboard capability on a mixed device, duplicates the input options and attributes and queues a NewInputDeviceRequest call. The new device only has the keyboard capability but is otherwise unchanged. The wacom driver has used this approach for years. The WorkProc is necessary to avoid inconsistent state, the server doesn't handle a NewInputDeviceRequest during PreInit well. The approach: During pre-init we create a struct xf86libinput_device with the libinput_device and a unique ID. The child device has that ID added to the options and will look for the other device during its pre-init. The two devices then share the xf86libinput_device struct. We only have a single epollfd for all devices and the server calls read_input on the first device in the list with the epollfd as pInfo->fd. That shared struct is used as the userdata on the libinput_device we get back from the event, and each device is in the xorg_list device_list of that shared struct. We loop through those to find the ones with the right capabilities and post the event through that device. Since devices can be enabled and disabled independently, the rest of the code makes sure that we only ever add the device to libinput when the first shared device is enabled, and remove it accordingly. [1] https://bugs.freedesktop.org/show_bug.cgi?id=49950 https://bugs.freedesktop.org/show_bug.cgi?id=92896 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18Add a helper function for the driver context initializationPeter Hutterer1-11/+16
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18Copy the device capabilities to the X driver structPeter Hutterer1-12/+22
And use those copied caps instead of the direct device capability calls. No functional changes at this point, this is preparation work for selectively disabling capabilities on a device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18Split type_name detection out into a helper functionPeter Hutterer1-11/+21
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18Unref the libinput context on pre_init failurePeter Hutterer1-0/+2
A device that fails pre_init has a ref to the libinput context but may not have a pInfo->private. For those devices we never call libinput_unref() and the libinput struct never gets freed. Thus if at least one device didn't pass pre_init, we never cleaned up after ourselves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-13Don't fail DEVICE_CLOSEPeter Hutterer1-0/+1
We're not doing anything here, so no reason to fail. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-13Remove unused server_fds listPeter Hutterer1-2/+0
Obsolete as of 353c52f2bec03 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-13Set the device to NULL after unrefPeter Hutterer1-0/+1
No real effect in the current code, but it adds a bit of safety. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-12Plug two memory leaksPeter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-27xf86-input-libinput 0.15.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-26Add property support for the accel profilesPeter Hutterer4-1/+186
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-18conf: install the libinput xorg.conf.d snippetPeter Hutterer2-1/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-18conf: don't hook onto tablets and joysticksPeter Hutterer1-4/+26
If we install the config file by default, we shouldn't use libinput for devices we know we can't handle. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-18conf: rename 99-libinput.conf to 90-libinput.confPeter Hutterer2-1/+1
This way it still sorts after the usual subjects, but it's easier to stack extra config in afterwards. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03Fix invalid pointer passed to the propertiesPeter Hutterer1-6/+6
Takes a void*, not a void** Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03Move the read-only properties into the same conditionPeter Hutterer1-6/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-31xf86-input-libinput 0.14.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-30Fix typo in libinput.manYomi01-1/+1
Correct typo. Draging to dragging.
2015-08-17Use xf86OpenSerial instead of a direct open() callPeter Hutterer1-4/+3
This will transparently handle server-side fds for us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Martin Pieuchot <mpi@openbsd.org>
2015-08-17Revamp server fd openingPeter Hutterer1-88/+39
The server already stores the server-fd in the options, so we only need to run through the list of current devices, find a match and extract that fd from the options. Less magic in our driver and it gives us a pInfo handle in open_restricted which we'll can use for xf86OpenSerial(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Martin Pieuchot <mpi@openbsd.org>
2015-08-13Add an option to disable horizontal scrollingPeter Hutterer3-1/+73
libinput always has horizontal scrolling enabled and punts the decision when to scroll horizontally to the toolkit/widget. This is the better approach, but while we have a stack that's not ready for that, and in the X case likely never will be fully ready provide an option to disable horizontal scrolling. This option doesn't really disable horizontal scrolling, it merely discards any horizontal scroll delta. libinput will still think it's scrolling. https://bugs.freedesktop.org/show_bug.cgi?id=91589 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-08-13Add drag lock supportPeter Hutterer11-5/+1195
First, why is this here and not in libinput: drag lock should be implemented in the compositor (not in libinput) so it can provide feedback when it activates and grouped in with other accessibility features. That will work for Wayland but in X the compositor cannot filter button events - only the server and the drivers can. This patch adds mostly the same functionality that evdev provides with two options on how it works: * a single button number configures the given button to lock the next button pressed in a logically down state until a press+ release of that same button again * a set of button number pairs configures each button with the to-be-locked logical button, i.e. a pair of "1 3" will hold 3 logically down after a button 1 press The property and the xorg.conf options take the same configuration as the evdev driver (though the property has a different prefix, libinput instead of Evdev). The behavior difference to evdev is in how releases are handled, evdev sends the release on the second button press event, this implementation sends the release on the second release event. https://bugs.freedesktop.org/show_bug.cgi?id=85577 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-08-12Remove unneeded header, epoll(7) interface is not directly used.Martin Pieuchot1-1/+0
Signed-off-by: Martin Pieuchot <mpi@openbsd.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-12Rename a local variable to not shadow the BSD strmode(3) function.Martin Pieuchot1-8/+8
Signed-off-by: Martin Pieuchot <mpi@openbsd.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-11gitignore: add patterns for automake test suite and misc other bitsPeter Hutterer1-0/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-11Rename main source file to x86libinput.cPeter Hutterer2-1/+1
To avoid conflict and confusion with libinput's sources. This was originally triggered by needing a header file for the driver which cannot be named libinput.h. That need went away after other refacturing, but we might as well rename it now, sooner or later we'll need a xf86libinput.h file. Can't do much about the libinput-properties header though, not worth breaking other projects and it's namespaced into /usr/include/xorg anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-04xf86-input-libinput 0.13.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-04Add a property for Disable While TypingStephen Chandler Paul4-2/+111
Signed-off-by: Stephen Chandler Paul <cpaul@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-21man: minor man page improvementsPeter Hutterer1-1/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-21Fix compiler warnings about touchpad gesturesPeter Hutterer2-1/+8
We don't do anything with them though. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-14xf86-input-libinput 0.12.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-09Add a property for tap drag lockPeter Hutterer4-1/+110
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-15Support buttons > BTN_BACK on micePeter Hutterer1-1/+1
https://bugzilla.redhat.com/show_bug.cgi?id=1230945 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-05xf86-input-libinput 0.11.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-01Fix missing scroll methods default/scroll button propertyPeter Hutterer1-3/+0
Even if no scroll method is enabled by default, we still want those properties. Introduced in 8d4e03570c. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22Use the new unaccelerated valuator ValuatorMask featuresPeter Hutterer1-1/+26
SDL Games like openarena rely on relative input that's handled by the DGA code in the server. That code casts the driver's input data to int and sends it to the client. libinput does pointer acceleration for us, so sending any deltas of less than 1 (likely for slow movements) ends up being 0. Use the new ValuatorMask accelerated/unaccelerated values to pass the unaccelerated values along, the server can then decide what to do with it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-22Only init abs axes if we don't have accelerationPeter Hutterer1-1/+13
A lot of devices (mainly MS input devices) have abs axes on top of the relative axes. Those axes are usually mute but with the current code we set up absolute axes for those devices. Relative events are then scaled by the server which makes the device appear slow. As an immediate fix always prefer relative axes and only set up absolute axes if the device has a calibration matrix but no pointer acceleration. This may mess up other devices where the relative axes are dead, we'll deal with this when it comes. https://bugs.freedesktop.org/show_bug.cgi?id=90322 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-21xf86-input-libinput 0.10.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-20Group scroll distances into a structPeter Hutterer1-12/+14
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-30Add option "ButtonMapping" (#90206)Peter Hutterer2-7/+88
With a long entry in the man page to detail what this option does. Specifically, it's the xorg.conf equivalent to XSetPointerMapping(3), it doesn't do any physical button remappings, merely the logical ones. If the physical button isn't mapped to the right logical button by default, that's either a libiput bug or an xkcd 1172 issue. X.Org Bug 90206 <http://bugs.freedesktop.org/show_bug.cgi?id=90206> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-29man: add two linebreaks to make things easier to visually parsePeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-29Move the option parsing into helper functionsPeter Hutterer1-187/+278
No functional changes, though I did move a free() up a bit in the process (see sendevents parsing). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-23Add a property for middle button emulationPeter Hutterer4-2/+103
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-23xf86-input-libinput 0.9.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-18Add "libinput something Default" propertiesPeter Hutterer3-1/+156
A client or xorg.conf setting may change the property but once changed it cannot be reset by a client to the original state without knowledge about the device. Export the various libinput_...get_default() functions as properties. https://bugs.freedesktop.org/show_bug.cgi?id=89574 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-18Add a helper function for making propertiesPeter Hutterer1-132/+80
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-18man: update the property list in the man pagePeter Hutterer1-4/+39
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>