test: don't leak open/closed counts into the next test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: fix inconsistent use of devnode vs input->path

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: plug a memory leak, all events need to be destroyed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Move closing the device fd into evdev.c

evdev_device_remove() already calls close(device->fd). Move the
close_restricted call there to avoid one privileged call in the backend and
one in the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: unify the error handling code with a goto

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: add error handling for failing to create a seat

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Store the backend type in the interface

This enables us to prevent callers from calling backend-specific functions on
mismatching backends.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: modify backend to allow for more than one device

This brings the path backend closer in line with the udev backend. This is
needed for Xorg input drivers that need to share a libinput context between
multiple device instances but still make use of the server's device hotplug
mechanisms.

Sharing an instance is needed for future features like disabling the touchpad
while typing, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: add libinput_path_add_device() and libinput_path_remove_device()

This allows multiple devices to share a single libinput context. The new
function returns the newly added device immediately. Unlike the udev seat
where devices may or may not be added - over the lifetime of the seat - a
path-based backend knows immediately if device exists or doesn't exist.

Returning the device is required by callers that have the event processing
separate from adding devices - by the time we have the DEVICE_ADDED event in
the queue we may have other events to process first. And the DEVICE_ADDED
event won't easily link to the path we gave it anyway, so it's hard to figure
out which DEVICE_ADDED event corresponds to the new device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
path: add libinput_path_create_context instead of libinput_create_from_path

Creates an empty context that is not hooked up to a device. Callers can then
add and remove devices to this context using libinput_path_add_device() and
libinput_path_remove_device().

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
udev: rename create_from_udev to udev_create_for_seat

An upcoming change requires a number of additions to the path backend. To
maintain proper namespacing rename the series to
	libinput_<backend>_<foo>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add an interface to enable/disable tapping.

I'm intentionally not adding a configuration interface for which tap
configures which button. IMO we should support one configuration and do that
well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
touchpad: hook up tapping to the new config bits

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: enable the required input properties on the touchpad devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: add test for tap default settings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
fixup! Add an interface to enable/disable tapping.
fixup! Add an interface to enable/disable tapping.
Add a configuration interface for a bunch of settings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>