Commit graph

18 commits

Author SHA1 Message Date
Peter Hutterer
002ef1635d cosmetic: drop double empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-20 09:57:39 +10:00
Peter Hutterer
e3a43902f9 Introduce device groups to group logical devices together
Devices like Wacom tablets have multiple event nodes (touch, pad and stylus).
This requires some logical grouping, e.g. setting an Intuos 5 tablet
left-handed effectively turns it upside down. That then applies to both the
stylus and the touch device.

Merging the devices into one struct libinput_device is not feasable, it
complicates the API for little benefit. A caller would still need access to
all subdevices to get udev handles, etc. Some configuration options apply to
the whole device (left-handed) but some (may) only apply to a single subdevice
(calibration, natural scrolling).

Addressing this would make the libinput API unwieldly and hard to use.

Instead, add a device group concept. Each device is a member of a device
group - a singleton for most devices. Wacom tablets will have a single group
across multiple devices, allowing the caller to associate the devices together
if needed.

The API is intentionally very simple and requires the caller to keep track of
groups and which/how many devices are in it. The caller has more powerful
libraries available to do that than we have.

This patch does not address the actual merging of devices into the same
device group, it simply creates a new group for each new device.

[rebased on top of 0.10]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-02-06 11:08:43 +10:00
Peter Hutterer
06b5342001 test: fix two compiler warnings
device.c:596:2: warning: incompatible pointer to integer conversion
initializing 'intmax_t' (aka 'long') with an expression of type 'struct
libinput_device *' [-Wint-conversion]
        ck_assert_int_eq(libinput_event_get_device(event),

use ck_assert_ptr_eq() instead

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-11 17:34:05 +10:00
Peter Hutterer
58abea3946 test: create a new device during the disable test to change fds
In the current test, disable followed by enable would result in the same fd
number for the new device, not exposing a bug fixed by
"evdev: Ensure the libevdev object receives the new fd on resume"

Create a keyboard device after suspending the first device, then re-enable the
device. This changes the fd to a different number, so we pick up on internal
bugs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-10 13:52:25 +10:00
Peter Hutterer
56b5f846ac Add libinput_device_get_context/libinput_seat_get_context
Allow retrieval of the libinput context from the seat and the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-12-03 09:09:42 +10:00
Peter Hutterer
8b7ef91c1a Add a function to retrieve the udev_device handle from a libinput device
The libinput device abstracts a number of things but sometimes the underlying
device is important. The udev device provides the necessary handle to access
that underlying device and various sysfs properties that may be necessary.

A function returning the device node would've done the same thing but is more
prone to race conditions than the udev_device.

https://bugs.freedesktop.org/show_bug.cgi?id=85573

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-12-03 09:09:39 +10:00
Peter Hutterer
d7106544ea test: move device ID test to test/device.c
More appropriate here, they were in misc because this file didn't exist yet
when they were added.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-01 13:32:16 +10:00
Peter Hutterer
77a2d7e8d9 test: rename LITEST_POINTER to LITEST_RELATIVE
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-11 09:55:42 +10:00
Peter Hutterer
c605276984 Merge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinput 2014-11-07 11:03:12 +10:00
Hans de Goede
00f74270e5 litest: Add a sleep_ms parameter to litest_touch_move_to
In reality moving a touch from point to another takes time. In some cases
(when a timeout may trigger during the move, e.g. tap-n-drag on a touchpad),
this is important. Add a sleep_ms parameter, which will cause
litest_touch_move_to to sleep the specified amount of ms every step.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-06 11:04:17 +01:00
Peter Hutterer
20d48e4181 Change sendevents configuration to use bitmasks
In the future, we should allow multiple sendevent modes set simultanously.
Change the API to use a bitmask instead of a single return value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-06 15:37:08 +10:00
Peter Hutterer
15527c73bd test: drop superfluous empty line
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-05 14:21:53 +10:00
Peter Hutterer
e4adbff919 test: add helper functions for the two timers we care about
Rather than a random msleep() with a comment, use a helper function that
describes what we're waiting for. Also makes changing the timeouts easier in
the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-23 14:38:37 +10:00
Peter Hutterer
45299593c0 test: Test the topbuttons of a disabled touchpad still send events through the trackpoint
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-09-19 08:20:09 +10:00
Peter Hutterer
490ec84e73 touchpad: implement conditional disabling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-18 13:29:42 +10:00
Peter Hutterer
195a02c7a4 test: test for release events on device suspend
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-18 13:29:42 +10:00
Peter Hutterer
45a7edb3fb touchpad: hook up sendevents configuration
We may be in the middle of a software button click or a tap, so make sure we
go back to the device-neutral state by unwinding.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-18 13:29:42 +10:00
Peter Hutterer
20831877d0 test: add test for device suspend/resume
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-18 11:31:23 +10:00