Commit graph

10 commits

Author SHA1 Message Date
Jonas Ådahl
b34139c9e7 Make it possible to have persistent libinput_seat instances
With this patch, a user can keep a reference to a libinput_seat
instance, which will cause the seat to never be unlinked from the
libinput context nor destroyed.

Previously, a when the last device of a seat was removed, the seat was
unlinked and if a new device was discovered with a previously empty seat
a new seat instance would always be created, meaning two potential seat
instances with identical physical and logical seat name pairs.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-10 22:28:46 +01:00
Peter Hutterer
75427b0788 udev: rename create_from_udev to udev_create_for_seat
Maintain proper namespacing rename the backend-specific calls to
	libinput_<backend>_<foo>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-10 11:23:36 +10:00
Peter Hutterer
20416ae4b7 test: Make sure the sysname of a device is correct
Currently this means start with "event" and don't contain /.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2014-01-31 14:57:18 +10:00
Peter Hutterer
54db6527ae Improve namespacing of event types
Now that the target of an event isn't exposed to the caller anymore, the
namespacing can be associated with a more intuitive one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-21 22:50:59 +01:00
Peter Hutterer
60d46e6bd7 Add a generic libinput_event_get_device() function
After dropping seat evens, all events are now are associated with a device, so
provide a generic accessor function and drop the custom ones.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-21 22:50:58 +01:00
Peter Hutterer
c29a8e8093 Split seats into having a physical and a logical name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-17 18:17:45 +10:00
Peter Hutterer
5b5b6bca06 Drop seat events
seats are more a compositor concept than a concept of the input library. All
devices in a libinput context are associated with the seat given on creation
of the seat (maps to ID_SEAT in udev for the udev backend).

A logical seat may be assigned to a device (e.g. WL_SEAT) but this does not
necessarily map to the creation of the seat in the compositor.
Drop the seat events but keep seat objects around so that the caller can still
identify which seat a device belongs to.

If the libinput_seat_unref() in the udev backend destroys the seat, the device
list of that seat is invalid and we'd be accessing already freed bytes. To
avoid this, ref the seat before the device removal loop, then unref it once
we're done - that unref then may trigger the actual removal of the seat.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-17 18:17:11 +10:00
Jonas Ådahl
9659511693 test: Add udev suspend->resume test
Tests that suspend removes devices and that resume rediscovers them.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-01-15 21:33:00 +01:00
Peter Hutterer
541b1c4891 test: udev suspend tests 2014-01-15 12:03:25 +10:00
Peter Hutterer
08d0c55e62 test: add a couple of tests for the udev-seat backend
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-15 12:03:25 +10:00