[PATCH libinput 3/9] path: store the udev device instead of just the devnode

2014-11-23 Thread Peter Hutterer
Long-term plan to use more of udev_device here is to better protect us against re-opening a different device that happens to have the same devnode. This now also prints an error message for invalid devices, the log tests are adjusted. Signed-off-by: Peter Hutterer --- src/path.c | 109 +

[PATCH libinput 4/9] evdev: use a udev_device instead of separate sysname/syspath/devnode

2014-11-23 Thread Peter Hutterer
Using a udev_device instead of the various bits separately safes us re-initializing udev contexts whenever we need to compare the device. And having the actual udev device makes it a bit easier to ensure that we're not re-initializing a different device as a current one. Signed-off-by: Peter Hutte

[PATCH libinput 1/9] path: keep the udev context around

2014-11-23 Thread Peter Hutterer
We need it for each device anyway, keep the ref around. Makes error handling a bit easier, we don't need to handle failing udev_new() and reduce the danger of mis-refcounting it. Signed-off-by: Peter Hutterer --- src/path.c | 33 +++-- src/path.h | 1 + 2 files chang

[PATCH libinput 8/9] Add libinput_device_set_seat_logical_name() to change seats at runtime

2014-11-23 Thread Peter Hutterer
The seat of a device is currently immutable, but a device may (in a multi-pointer case) move between different logical seats. Moving it between seats is akin to removing it and re-plugging it, so let's do exactly that. The physical seat name stays immutable. Pro: - device handling after changing

[PATCH libinput 6/9] udev: optionally pass the seat name into device_added()

2014-11-23 Thread Peter Hutterer
Prep work for changing seat names on devices. No functional changes. Signed-off-by: Peter Hutterer --- src/udev-seat.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/udev-seat.c b/src/udev-seat.c index 49c8f47..c69d175 100644 --- a/src/udev-seat.c +++ b/src

[PATCH libinput 7/9] path: optionally pass the seat name into path_device_enable()

2014-11-23 Thread Peter Hutterer
Prep work for changing seat names on devices. No functional changes. Signed-off-by: Peter Hutterer --- src/path.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/path.c b/src/path.c index 9d0632a..fef1d46 100644 --- a/src/path.c +++ b/src/p

[PATCH libinput 0/9] Changing logical seat names

2014-11-23 Thread Peter Hutterer
libinput devices are assigned to a struct libinput_seat that is immutable. The seat consists of physical seat (e.g. "seat0", i.e. ID_SEAT) and a logical seat ("default", WL_SEAT if available). The physical seat is used as filter whether a device is added at all, the logical seat effectively corr

[PATCH libinput 5/9] evdev: remove a race condition opening the wrong device

2014-11-23 Thread Peter Hutterer
Potential race condition: - udev notifies us that a udev_device became available - we go for a coffee and chat to the neighbours on the way - the device is unplugged - a new device is plugged in, gets the same devnode - we finish our coffee and come back - open(udev_device_get_devnode()) - new devi

[PATCH libinput 2/9] path: split out creating a device into a helper function

2014-11-23 Thread Peter Hutterer
No functional changes Signed-off-by: Peter Hutterer --- src/path.c | 57 - 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/src/path.c b/src/path.c index f986afd..5900775 100644 --- a/src/path.c +++ b/src/path.c @@ -236,6 +23

[PATCH libinput 9/9] test: add seat changing tests

2014-11-23 Thread Peter Hutterer
Signed-off-by: Peter Hutterer --- test/path.c | 71 ++- test/udev.c | 78 - 2 files changed, 147 insertions(+), 2 deletions(-) diff --git a/test/path.c b/test/path.c index ecb7839..3a2

Re: FreeBSD libinput

2014-11-23 Thread Peter Hutterer
On Fri, Nov 21, 2014 at 09:10:24PM -0700, Ales Katona wrote: > I wanted to try and compile libinput under freeBSD seeing how epoll has > been patched into kqueue on the platform, but I'm getting stopped by > configure saying it can't find EPOLL_CLOEXEC. Is this just a configure > block or is the co