From b07876d23a929faa5c61d9180810fedc0fcaeb51 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Jan 2012 16:41:21 +0200 Subject: [PATCH] evdev: warn about missing input devices Usually there should be at least one input device, when Weston starts up, or is reactivated by a VT switch. Add a nice warning, in case there are no input devices. This is to give a clue to users who happen to try Weston on DRM, and do not get any response. Add also a message to another failure case, that may lead to missing input devices. Signed-off-by: Pekka Paalanen --- src/evdev.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 0b2fdfa9..39e04d8e 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -545,6 +545,16 @@ evdev_add_devices(struct udev *udev, struct weston_input_device *input_base) udev_device_unref(device); } udev_enumerate_unref(e); + + if (wl_list_empty(&input->devices_list)) { + fprintf(stderr, + "warning: no input devices on entering Weston. " + "Possible causes:\n" + "\t- no permissions to read /dev/input/evdev*\n" + "\t- seats misconfigured " + "(Weston backend option 'seat', " + "udev device property ID_SEAT)\n"); + } } static int @@ -581,8 +591,10 @@ evdev_config_udev_monitor(struct udev *udev, struct evdev_input *master) struct weston_compositor *c = master->base.compositor; master->udev_monitor = udev_monitor_new_from_netlink(udev, "udev"); - if (!master->udev_monitor) + if (!master->udev_monitor) { + fprintf(stderr, "udev: failed to create the udev monitor\n"); return 0; + } udev_monitor_filter_add_match_subsystem_devtype(master->udev_monitor, "input", NULL);