From 606249f91ca2224a7831eecf24dffa66469c33c8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 29 Jan 2014 15:38:48 +1000 Subject: 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 --- tools/event-debug.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools') 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; } -- cgit v1.2.1