[PATCH weston] udev-seat: Fail seat setup only if the seat is incomplete
Kristian Høgsberg
hoegsberg at gmail.com
Mon May 20 14:25:14 PDT 2013
On Mon, May 20, 2013 at 05:55:03PM +0100, Rob Bradford wrote:
> 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;
> + }
> +
I wonder if the previous check isn't good enough - I think requiring a
keyboard and a mouse is a little restrictive, there are many cases
where we only have a keyboard or only a mouse. And if we do want this
more specific check, at least drop the check for an empty
devices_list.
> return 0;
> }
>
> --
> 1.8.1.4
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list