|
|
|
@ -237,13 +237,13 @@ out: |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
udev_input_enable(struct udev_input *input, struct udev *udev) |
|
|
|
|
udev_input_enable(struct udev_input *input) |
|
|
|
|
{ |
|
|
|
|
struct wl_event_loop *loop; |
|
|
|
|
struct weston_compositor *c = input->compositor; |
|
|
|
|
int fd; |
|
|
|
|
|
|
|
|
|
input->udev_monitor = udev_monitor_new_from_netlink(udev, "udev"); |
|
|
|
|
input->udev_monitor = udev_monitor_new_from_netlink(input->udev, "udev"); |
|
|
|
|
if (!input->udev_monitor) { |
|
|
|
|
weston_log("udev: failed to create the udev monitor\n"); |
|
|
|
|
return -1; |
|
|
|
@ -268,7 +268,7 @@ udev_input_enable(struct udev_input *input, struct udev *udev) |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (udev_input_add_devices(input, udev) < 0) |
|
|
|
|
if (udev_input_add_devices(input, input->udev) < 0) |
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
input->enabled = 1; |
|
|
|
@ -316,7 +316,9 @@ udev_input_init(struct udev_input *input, struct weston_compositor *c, struct ud |
|
|
|
|
memset(input, 0, sizeof *input); |
|
|
|
|
input->seat_id = strdup(seat_id); |
|
|
|
|
input->compositor = c; |
|
|
|
|
if (udev_input_enable(input, udev) < 0) |
|
|
|
|
input->udev = udev; |
|
|
|
|
input->udev = udev_ref(udev); |
|
|
|
|
if (udev_input_enable(input) < 0) |
|
|
|
|
goto err; |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
@ -333,6 +335,7 @@ udev_input_destroy(struct udev_input *input) |
|
|
|
|
udev_input_disable(input); |
|
|
|
|
wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link) |
|
|
|
|
udev_seat_destroy(seat); |
|
|
|
|
udev_unref(input->udev); |
|
|
|
|
free(input->seat_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|