udev-seat: Make udev_seat_get_named take struct udev_input pointer
No functional changes; API generalization in preparation for multiple input backends. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
77c1a5b7dc
commit
58e158658f
@@ -1843,7 +1843,7 @@ setup_output_seat_constraint(struct drm_compositor *ec,
|
|||||||
if (strcmp(s, "") != 0) {
|
if (strcmp(s, "") != 0) {
|
||||||
struct udev_seat *seat;
|
struct udev_seat *seat;
|
||||||
|
|
||||||
seat = udev_seat_get_named(&ec->base, s);
|
seat = udev_seat_get_named(&ec->input, s);
|
||||||
if (seat)
|
if (seat)
|
||||||
seat->base.output = output;
|
seat->base.output = output;
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -35,8 +35,6 @@
|
|||||||
static const char default_seat[] = "seat0";
|
static const char default_seat[] = "seat0";
|
||||||
static const char default_seat_name[] = "default";
|
static const char default_seat_name[] = "default";
|
||||||
|
|
||||||
static struct udev_seat *
|
|
||||||
udev_seat_create(struct weston_compositor *c, const char *seat_name);
|
|
||||||
static void
|
static void
|
||||||
udev_seat_destroy(struct udev_seat *seat);
|
udev_seat_destroy(struct udev_seat *seat);
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
|
|||||||
if (!seat_name)
|
if (!seat_name)
|
||||||
seat_name = default_seat_name;
|
seat_name = default_seat_name;
|
||||||
|
|
||||||
seat = udev_seat_get_named(c, seat_name);
|
seat = udev_seat_get_named(input, seat_name);
|
||||||
|
|
||||||
if (seat == NULL)
|
if (seat == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -365,8 +363,9 @@ notify_output_create(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct udev_seat *
|
static struct udev_seat *
|
||||||
udev_seat_create(struct weston_compositor *c, const char *seat_name)
|
udev_seat_create(struct udev_input *input, const char *seat_name)
|
||||||
{
|
{
|
||||||
|
struct weston_compositor *c = input->compositor;
|
||||||
struct udev_seat *seat;
|
struct udev_seat *seat;
|
||||||
|
|
||||||
seat = zalloc(sizeof *seat);
|
seat = zalloc(sizeof *seat);
|
||||||
@@ -393,8 +392,9 @@ udev_seat_destroy(struct udev_seat *seat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct udev_seat *
|
struct udev_seat *
|
||||||
udev_seat_get_named(struct weston_compositor *c, const char *seat_name)
|
udev_seat_get_named(struct udev_input *input, const char *seat_name)
|
||||||
{
|
{
|
||||||
|
struct weston_compositor *c = input->compositor;
|
||||||
struct udev_seat *seat;
|
struct udev_seat *seat;
|
||||||
|
|
||||||
wl_list_for_each(seat, &c->seat_list, base.link) {
|
wl_list_for_each(seat, &c->seat_list, base.link) {
|
||||||
@@ -402,7 +402,7 @@ udev_seat_get_named(struct weston_compositor *c, const char *seat_name)
|
|||||||
return seat;
|
return seat;
|
||||||
}
|
}
|
||||||
|
|
||||||
seat = udev_seat_create(c, seat_name);
|
seat = udev_seat_create(input, seat_name);
|
||||||
|
|
||||||
if (!seat)
|
if (!seat)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
+1
-1
@@ -51,6 +51,6 @@ int udev_input_init(struct udev_input *input,
|
|||||||
const char *seat_id);
|
const char *seat_id);
|
||||||
void udev_input_destroy(struct udev_input *input);
|
void udev_input_destroy(struct udev_input *input);
|
||||||
|
|
||||||
struct udev_seat *udev_seat_get_named(struct weston_compositor *c,
|
struct udev_seat *udev_seat_get_named(struct udev_input *input,
|
||||||
const char *seat_name);
|
const char *seat_name);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user