summaryrefslogtreecommitdiff
path: root/tools/shared.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-12-23 11:13:33 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-12-23 11:14:39 +1000
commitdf472317194f3ef83c4c22cd134b0639a8536367 (patch)
tree1ff3bae1aaf98bd0d08531c42227d4eae5b625ce /tools/shared.c
parent6ee8c5854ca574e76d5f4a59f9cd4041a8279e64 (diff)
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 <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/shared.c')
-rw-r--r--tools/shared.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/shared.c b/tools/shared.c
index 8439cb2..3e1368d 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();