|
|
@ -469,7 +469,7 @@ evdev_configure_device(struct evdev_input_device *device) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static struct evdev_input_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) |
|
|
|
const char *path, int device_fd) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct evdev_input_device *device; |
|
|
|
struct evdev_input_device *device; |
|
|
@ -478,12 +478,13 @@ evdev_input_device_create(struct evdev_seat *master, |
|
|
|
device = malloc(sizeof *device); |
|
|
|
device = malloc(sizeof *device); |
|
|
|
if (device == NULL) |
|
|
|
if (device == NULL) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
|
|
|
|
memset(device, 0, sizeof *device); |
|
|
|
|
|
|
|
|
|
|
|
ec = master->base.compositor; |
|
|
|
ec = seat->compositor; |
|
|
|
device->output = |
|
|
|
device->output = |
|
|
|
container_of(ec->output_list.next, struct weston_output, link); |
|
|
|
container_of(ec->output_list.next, struct weston_output, link); |
|
|
|
|
|
|
|
|
|
|
|
device->seat = &master->base; |
|
|
|
device->seat = seat; |
|
|
|
device->is_mt = 0; |
|
|
|
device->is_mt = 0; |
|
|
|
device->mtdev = NULL; |
|
|
|
device->mtdev = NULL; |
|
|
|
device->devnode = strdup(path); |
|
|
|
device->devnode = strdup(path); |
|
|
@ -515,8 +516,6 @@ evdev_input_device_create(struct evdev_seat *master, |
|
|
|
if (device->source == NULL) |
|
|
|
if (device->source == NULL) |
|
|
|
goto err2; |
|
|
|
goto err2; |
|
|
|
|
|
|
|
|
|
|
|
wl_list_insert(master->devices_list.prev, &device->link); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return device; |
|
|
|
return device; |
|
|
|
|
|
|
|
|
|
|
|
err2: |
|
|
|
err2: |
|
|
@ -575,11 +574,14 @@ device_added(struct udev_device *udev_device, struct evdev_seat *master) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
device = evdev_input_device_create(master, devnode, fd); |
|
|
|
device = evdev_input_device_create(&master->base, devnode, fd); |
|
|
|
if (!device) { |
|
|
|
if (!device) { |
|
|
|
close(fd); |
|
|
|
close(fd); |
|
|
|
weston_log("not using input device '%s'.\n", devnode); |
|
|
|
weston_log("not using input device '%s'.\n", devnode); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_list_insert(master->devices_list.prev, &device->link); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|