diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-01-29 15:38:48 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-02-10 11:23:36 +1000 |
commit | 606249f91ca2224a7831eecf24dffa66469c33c8 (patch) | |
tree | d9126033c2cf256526865adcd06708c3a845e766 /tools | |
parent | 69dcea11b9e8a19541bdb7c47b5a285c99b72f7f (diff) | |
download | libinput-606249f91ca2224a7831eecf24dffa66469c33c8.tar.gz |
path: add libinput_path_create_context instead of libinput_create_from_path
Creates an empty context that is not hooked up to a device. Callers can then
add and remove devices to this context using libinput_path_add_device() and
libinput_path_remove_device().
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/event-debug.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/event-debug.c b/tools/event-debug.c index bbb358bb..3e89bf13 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -151,11 +151,21 @@ open_udev(struct libinput **li) static int open_device(struct libinput **li, const char *path) { - *li = libinput_create_from_path(&interface, NULL, path); + struct libinput_device *device; + + *li = libinput_path_create_context(&interface, NULL); if (!*li) { fprintf(stderr, "Failed to initialize context from %s\n", path); return 1; } + + device = libinput_path_add_device(*li, path); + if (!device) { + fprintf(stderr, "Failed to initialized device %s\n", path); + libinput_destroy(*li); + return 1; + } + return 0; } |