diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-05-05 18:21:58 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-05-05 18:21:58 +0200 |
commit | 5a5bd3a6f2c25a965bd17f4d6ec4890838a63d2c (patch) | |
tree | ecfd4a751e576b4af32e96ce5005cb2045ca7068 /src/uterm_monitor.c | |
parent | d1be1d60fa1cf03a6c8eefbe880d8f7dc213855d (diff) |
uterm_monitor: add input device support
To allow moving all input handling to uterm, too, we need to detect input
devices in the uterm-monitor like all other devices, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/uterm_monitor.c')
-rw-r--r-- | src/uterm_monitor.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/uterm_monitor.c b/src/uterm_monitor.c index e2fa090..846a201 100644 --- a/src/uterm_monitor.c +++ b/src/uterm_monitor.c @@ -348,6 +348,8 @@ static void monitor_udev_add(struct uterm_monitor *mon, return; } type = UTERM_MONITOR_FBDEV; + } else if (!strcmp(subs, "input")) { + type = UTERM_MONITOR_INPUT; } else { log_debug("adding device with unknown subsystem %s", subs); return; @@ -543,6 +545,15 @@ int uterm_monitor_new(struct uterm_monitor **out, goto err_umon; } + ret = udev_monitor_filter_add_match_subsystem_devtype(mon->umon, + "input", NULL); + if (ret) { + errno = -ret; + log_err("cannot add udev filter (%d): %m", ret); + ret = -EFAULT; + goto err_umon; + } + ret = udev_monitor_filter_add_match_tag(mon->umon, "seat"); if (ret) { errno = -ret; @@ -665,6 +676,13 @@ void uterm_monitor_scan(struct uterm_monitor *mon) goto out_enum; } + ret = udev_enumerate_add_match_subsystem(e, "input"); + if (ret) { + errno = -ret; + log_err("cannot add udev match (%d): %m", ret); + goto out_enum; + } + ret = udev_enumerate_add_match_tag(e, "seat"); if (ret) { errno = -ret; |