[PATCH weston] udev-seat: Fail seat setup only if the seat is incomplete
Rob Bradford
robert.bradford at intel.com
Mon May 20 09:55:03 PDT 2013
From: Rob Bradford <rob at linux.intel.com>
Rather than failing seat setup if we fail to open the input device
instead fail the seat setup if we don't have "complete seat" with both
keyboard and pointer or a touchscreen.
https://bugs.freedesktop.org/show_bug.cgi?id=64506
---
src/udev-seat.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/udev-seat.c b/src/udev-seat.c
index 7e62429..3dd3438 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -58,7 +58,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master)
fd = weston_launcher_open(c, devnode, O_RDWR | O_NONBLOCK);
if (fd < 0) {
weston_log("opening input device '%s' failed.\n", devnode);
- return -1;
+ return 0;
}
device = evdev_device_create(&master->base, devnode, fd);
@@ -69,7 +69,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master)
} else if (device == NULL) {
close(fd);
weston_log("failed to create input device '%s'.\n", devnode);
- return -1;
+ return 0;
}
calibration_values =
@@ -142,6 +142,12 @@ udev_seat_add_devices(struct udev_seat *seat, struct udev *udev)
"udev device property ID_SEAT)\n");
}
+ if (!(seat->base.touch || (seat->base.keyboard && seat->base.pointer))) {
+ weston_log ("seat not complete: no touchscreen or "
+ "no keyboard and pointer found.\n");
+ return -1;
+ }
+
return 0;
}
--
1.8.1.4
More information about the wayland-devel
mailing list