mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 06:08:08 +02:00
udev-seat: Make the udev_input structure an embedded structure
And as a result of this stop iterating through the compositor seat list (of one item) and instead access the udev_input structure directly. This enables a refactoring to pull out the weston_seat into a separate structure permitting multiple seats.
This commit is contained in:
parent
a16790bcd7
commit
8065462d6d
2 changed files with 8 additions and 15 deletions
|
|
@ -260,16 +260,10 @@ drm_led_update(struct weston_seat *seat_base, enum weston_led leds)
|
||||||
evdev_led_update(device, leds);
|
evdev_led_update(device, leds);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct udev_input *
|
int
|
||||||
udev_input_create(struct weston_compositor *c, struct udev *udev,
|
udev_input_init(struct udev_input *input, struct weston_compositor *c, struct udev *udev,
|
||||||
const char *seat_id)
|
const char *seat_id)
|
||||||
{
|
{
|
||||||
struct udev_input *input;
|
|
||||||
|
|
||||||
input = malloc(sizeof *input);
|
|
||||||
if (input == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memset(input, 0, sizeof *input);
|
memset(input, 0, sizeof *input);
|
||||||
weston_seat_init(&input->base, c, "default");
|
weston_seat_init(&input->base, c, "default");
|
||||||
input->base.led_update = drm_led_update;
|
input->base.led_update = drm_led_update;
|
||||||
|
|
@ -279,12 +273,11 @@ udev_input_create(struct weston_compositor *c, struct udev *udev,
|
||||||
if (udev_input_enable(input, udev) < 0)
|
if (udev_input_enable(input, udev) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
return input;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
free(input->seat_id);
|
free(input->seat_id);
|
||||||
free(input);
|
return -1;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -294,5 +287,4 @@ udev_input_destroy(struct udev_input *input)
|
||||||
|
|
||||||
weston_seat_release(&input->base);
|
weston_seat_release(&input->base);
|
||||||
free(input->seat_id);
|
free(input->seat_id);
|
||||||
free(input);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,10 @@ struct udev_input {
|
||||||
|
|
||||||
int udev_input_enable(struct udev_input *input, struct udev *udev);
|
int udev_input_enable(struct udev_input *input, struct udev *udev);
|
||||||
void udev_input_disable(struct udev_input *input);
|
void udev_input_disable(struct udev_input *input);
|
||||||
struct udev_input *udev_input_create(struct weston_compositor *c,
|
int udev_input_init(struct udev_input *input,
|
||||||
struct udev *udev,
|
struct weston_compositor *c,
|
||||||
const char *seat_id);
|
struct udev *udev,
|
||||||
|
const char *seat_id);
|
||||||
void udev_input_destroy(struct udev_input *input);
|
void udev_input_destroy(struct udev_input *input);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue