summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-08-03 14:39:03 +0300
committerKristian Høgsberg <krh@bitplanet.net>2012-08-03 13:18:59 -0400
commit43f0a1efcb16e5a93705d72cbc7321117ebeb536 (patch)
treed5660d38dd5bb8dfde078a51f7e3ffe47e0315e3 /src/evdev.c
parent3bfb20104d7aa93345f8e56ca2b3098fc87c1dcd (diff)
downloadweston-43f0a1efcb16e5a93705d72cbc7321117ebeb536.tar.gz
weston-43f0a1efcb16e5a93705d72cbc7321117ebeb536.tar.bz2
weston-43f0a1efcb16e5a93705d72cbc7321117ebeb536.zip
evdev: pass weston_seat to evdev_input_device_create()
in preparation of removing evdev_seat Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 40f60800..7a46a5c7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -469,7 +469,7 @@ evdev_configure_device(struct evdev_input_device *device)
}
static struct evdev_input_device *
-evdev_input_device_create(struct evdev_seat *master,
+evdev_input_device_create(struct weston_seat *seat,
const char *path, int device_fd)
{
struct evdev_input_device *device;
@@ -478,12 +478,13 @@ evdev_input_device_create(struct evdev_seat *master,
device = malloc(sizeof *device);
if (device == NULL)
return NULL;
+ memset(device, 0, sizeof *device);
- ec = master->base.compositor;
+ ec = seat->compositor;
device->output =
container_of(ec->output_list.next, struct weston_output, link);
- device->seat = &master->base;
+ device->seat = seat;
device->is_mt = 0;
device->mtdev = NULL;
device->devnode = strdup(path);
@@ -515,8 +516,6 @@ evdev_input_device_create(struct evdev_seat *master,
if (device->source == NULL)
goto err2;
- wl_list_insert(master->devices_list.prev, &device->link);
-
return device;
err2:
@@ -575,11 +574,14 @@ device_added(struct udev_device *udev_device, struct evdev_seat *master)
return;
}
- device = evdev_input_device_create(master, devnode, fd);
+ device = evdev_input_device_create(&master->base, devnode, fd);
if (!device) {
close(fd);
weston_log("not using input device '%s'.\n", devnode);
+ return;
}
+
+ wl_list_insert(master->devices_list.prev, &device->link);
}
static void