void *dummy_surface_data;
int has_rgb565;
+ int seat_version;
};
enum {
}
}
+static void
+seat_handle_name(void *data, struct wl_seat *seat,
+ const char *name)
+{
+
+}
+
static const struct wl_seat_listener seat_listener = {
seat_handle_capabilities,
+ seat_handle_name
};
void
xkb_map_unref(input->xkb.keymap);
}
+#define MAX(a,b) ((a) > (b) ? a : b)
+
static void
display_add_input(struct display *d, uint32_t id)
{
input = xzalloc(sizeof *input);
input->display = d;
- input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, 1);
+ input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface,
+ MAX(d->seat_version, 3));
input->touch_focus = NULL;
input->pointer_focus = NULL;
input->keyboard_focus = NULL;
data_offer_destroy(input->selection_offer);
wl_data_device_destroy(input->data_device);
+
+ if (input->display->seat_version >= 3) {
+ if (input->pointer)
+ wl_pointer_release(input->pointer);
+ if (input->keyboard)
+ wl_keyboard_release(input->keyboard);
+ }
+
fini_xkb(input);
wl_surface_destroy(input->pointer_surface);
} else if (strcmp(interface, "wl_output") == 0) {
display_add_output(d, id);
} else if (strcmp(interface, "wl_seat") == 0) {
+ d->seat_version = version;
display_add_input(d, id);
} else if (strcmp(interface, "wl_shell") == 0) {
d->shell = wl_registry_bind(registry,