[PATCH weston 03/10] weston-info: Report the seat name provided by the compositor
Rob Bradford
robert.bradford at intel.com
Fri May 31 10:09:52 PDT 2013
From: Rob Bradford <rob at linux.intel.com>
---
clients/weston-info.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/clients/weston-info.c b/clients/weston-info.c
index a5db02a..03b4c40 100644
--- a/clients/weston-info.c
+++ b/clients/weston-info.c
@@ -84,6 +84,7 @@ struct seat_info {
struct wl_seat *seat;
uint32_t capabilities;
+ char *name;
};
struct weston_info {
@@ -233,6 +234,7 @@ print_seat_info(void *data)
print_global_info(data);
+ printf("\tname: %s\n", seat->name);
printf("\tcapabilities:");
if (seat->capabilities & WL_SEAT_CAPABILITY_POINTER)
@@ -253,8 +255,17 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
seat->capabilities = caps;
}
+static void
+seat_handle_name(void *data, struct wl_seat *wl_seat,
+ const char *name)
+{
+ struct seat_info *seat = data;
+ seat->name = strdup(name);
+}
+
static const struct wl_seat_listener seat_listener = {
seat_handle_capabilities,
+ seat_handle_name,
};
static void
@@ -266,7 +277,7 @@ add_seat_info(struct weston_info *info, uint32_t id, uint32_t version)
seat->global.print = print_seat_info;
seat->seat = wl_registry_bind(info->registry,
- id, &wl_seat_interface, 1);
+ id, &wl_seat_interface, 2);
wl_seat_add_listener(seat->seat, &seat_listener, seat);
info->roundtrip_needed = true;
--
1.8.1.4
More information about the wayland-devel
mailing list