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 <ppaalanen@gmail.com>
dev
Pekka Paalanen 13 years ago
parent c0444e3ad6
commit b07876d23a
  1. 14
      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);

Loading…
Cancel
Save