input: Add a seat name parameter to weston_seat_init
diff --git a/src/compositor-headless.c b/src/compositor-headless.c
index e250b98..c9194d0 100644
--- a/src/compositor-headless.c
+++ b/src/compositor-headless.c
@@ -172,7 +172,7 @@
if (weston_compositor_init(&c->base, display, argc, argv, config) < 0)
goto err_free;
- weston_seat_init(&c->fake_seat, &c->base);
+ weston_seat_init(&c->fake_seat, &c->base, "default");
c->base.destroy = headless_destroy;
c->base.restore = headless_restore;
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index b81d789..93c3c16 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -915,6 +915,7 @@
rdpSettings *settings;
rdpInput *input;
RdpPeerContext *peerCtx;
+ char seat_name[32];
client->context_size = sizeof(RdpPeerContext);
client->ContextNew = (psPeerContextNew)rdp_peer_context_new;
@@ -947,7 +948,11 @@
input->ExtendedMouseEvent = xf_extendedMouseEvent;
input->KeyboardEvent = xf_input_keyboard_event;
input->UnicodeKeyboardEvent = xf_input_unicode_keyboard_event;
- weston_seat_init(&peerCtx->item.seat, &c->base);
+
+ if (snprintf(seat_name, 32, "rdp:%d:%s", client->sockfd, client->hostname) >= 32)
+ seat_name[31] = '\0';
+
+ weston_seat_init(&peerCtx->item.seat, &c->base, seat_name);
client->Initialize(client);
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index 3d95d30..b4dc996 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -605,7 +605,7 @@
return;
memset(seat, 0, sizeof *seat);
- weston_seat_init(&seat->base, c);
+ weston_seat_init(&seat->base, c, "default");
seat->base.led_update = rpi_led_update;
wl_list_init(&seat->devices_list);
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index d253d87..9489161 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -638,7 +638,7 @@
memset(input, 0, sizeof *input);
- weston_seat_init(&input->base, &c->base);
+ weston_seat_init(&input->base, &c->base, "default");
input->compositor = c;
input->seat = wl_registry_bind(c->parent.registry, id,
&wl_seat_interface, 1);
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 483d799..f17edb4 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -291,7 +291,7 @@
{
struct xkb_keymap *keymap;
- weston_seat_init(&c->core_seat, &c->base);
+ weston_seat_init(&c->core_seat, &c->base, "default");
if (no_input)
return 0;
diff --git a/src/compositor.h b/src/compositor.h
index 2fba05b..22700b7 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -447,6 +447,7 @@
} xkb_state;
struct input_method *input_method;
+ char *seat_name;
};
enum {
@@ -1031,7 +1032,8 @@
weston_output_destroy(struct weston_output *output);
void
-weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec);
+weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
+ const char *seat_name);
void
weston_seat_init_pointer(struct weston_seat *seat);
int
diff --git a/src/input.c b/src/input.c
index 89f74f4..ae75054 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1466,7 +1466,8 @@
}
WL_EXPORT void
-weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec)
+weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
+ const char *seat_name)
{
memset(seat, 0, sizeof *seat);
@@ -1482,6 +1483,7 @@
seat->compositor = ec;
seat->modifier_state = 0;
seat->num_tp = 0;
+ seat->seat_name = strdup(seat_name);
wl_list_insert(ec->seat_list.prev, &seat->link);
@@ -1507,5 +1509,7 @@
if (seat->touch)
weston_touch_destroy(seat->touch);
+ free (seat->seat_name);
+
wl_signal_emit(&seat->destroy_signal, seat);
}
diff --git a/src/udev-seat.c b/src/udev-seat.c
index 12a531c..dbbb80c 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -271,7 +271,7 @@
return NULL;
memset(seat, 0, sizeof *seat);
- weston_seat_init(&seat->base, c);
+ weston_seat_init(&seat->base, c, "default");
seat->base.led_update = drm_led_update;
wl_list_init(&seat->devices_list);