From: Peter Hutterer Date: Tue, 23 Dec 2014 01:13:33 +0000 (+1000) Subject: tools: pass the userdata to the context X-Git-Tag: 0.8.0~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df472317194f3ef83c4c22cd134b0639a8536367;p=platform%2Fupstream%2Flibinput.git tools: pass the userdata to the context The event-gui needs this but it got dropped in 6ee8c585, causing a crash. Oops. Signed-off-by: Peter Hutterer --- diff --git a/tools/event-debug.c b/tools/event-debug.c index ffc9a132..da581c82 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -368,7 +368,7 @@ main(int argc, char **argv) if (tools_parse_args(argc, argv, &options)) return 1; - li = tools_open_backend(&options, &interface); + li = tools_open_backend(&options, NULL, &interface); if (!li) return 1; diff --git a/tools/event-gui.c b/tools/event-gui.c index b950f92c..9a08d8ef 100644 --- a/tools/event-gui.c +++ b/tools/event-gui.c @@ -523,7 +523,7 @@ main(int argc, char *argv[]) if (!udev) error("Failed to initialize udev\n"); - li = tools_open_backend(&options, &interface); + li = tools_open_backend(&options, &w, &interface); if (!li) return 1; diff --git a/tools/shared.c b/tools/shared.c index 8439cb27..3e1368d1 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -170,6 +170,7 @@ tools_parse_args(int argc, char **argv, struct tools_options *options) static struct libinput * open_udev(const struct libinput_interface *interface, + void *userdata, const char *seat, int verbose) { @@ -181,7 +182,7 @@ open_udev(const struct libinput_interface *interface, return NULL; } - li = libinput_udev_create_context(interface, NULL, udev); + li = libinput_udev_create_context(interface, userdata, udev); if (!li) { fprintf(stderr, "Failed to initialize context from udev\n"); goto out; @@ -206,13 +207,14 @@ out: static struct libinput * open_device(const struct libinput_interface *interface, + void *userdata, const char *path, int verbose) { struct libinput_device *device; struct libinput *li; - li = libinput_path_create_context(interface, NULL); + li = libinput_path_create_context(interface, userdata); if (!li) { fprintf(stderr, "Failed to initialize context from %s\n", path); return NULL; @@ -235,14 +237,15 @@ open_device(const struct libinput_interface *interface, struct libinput * tools_open_backend(struct tools_options *options, + void *userdata, const struct libinput_interface *interface) { struct libinput *li = NULL; if (options->backend == BACKEND_UDEV) { - li = open_udev(interface, options->seat, options->verbose); + li = open_udev(interface, userdata, options->seat, options->verbose); } else if (options->backend == BACKEND_DEVICE) { - li = open_device(interface, options->device, options->verbose); + li = open_device(interface, userdata, options->device, options->verbose); } else abort(); diff --git a/tools/shared.h b/tools/shared.h index 9ecd3adb..4388cea6 100644 --- a/tools/shared.h +++ b/tools/shared.h @@ -44,6 +44,7 @@ struct tools_options { void tools_init_options(struct tools_options *options); int tools_parse_args(int argc, char **argv, struct tools_options *options); struct libinput* tools_open_backend(struct tools_options *options, + void *userdata, const struct libinput_interface *interface); void tools_device_apply_config(struct libinput_device *device, struct tools_options *options);