~moody/drawterm

bf96ad4c2901ac5128bd1ba004a013e286f94fc7 — Jacob Moody 2 months ago c99a7f4 front
gui-wl: dont bind more then one seat

We dont currently have any logic for handling multiseat, so we should
avoid binding more then one seat. This locks us to the first seat, which is
often the default. This also moves the data managers binding over to the
seat binding, these managers are scoped per seat so our binding logic
should reflect that.
1 files changed, 7 insertions(+), 6 deletions(-)

M gui-wl/wl-cb.c
M gui-wl/wl-cb.c => gui-wl/wl-cb.c +7 -6
@@ 376,7 376,6 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, uint32_t capabilities
static void
seat_handle_name(void *data, struct wl_seat *seat, const char *name)
{

}

static const struct wl_seat_listener seat_listener = {


@@ 526,8 525,14 @@ handle_global(void *data, struct wl_registry *registry, uint32_t name, const cha
	if(strcmp(interface, wl_shm_interface.name) == 0) {
		wl->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
	} else if(strcmp(interface, wl_seat_interface.name) == 0) {
		//We don't support multiseat
		if(wl->seat != nil)
			return;
		wl->seat = wl_registry_bind(registry, name, &wl_seat_interface, 4);
		wl_seat_add_listener(wl->seat, &seat_listener, wl);
		wl->data_device = wl_data_device_manager_get_data_device(wl->data_device_manager, wl->seat);
		wl_data_device_add_listener(wl->data_device, &data_device_listener, wl);
		wl->primsel_device = zwp_primary_selection_device_manager_v1_get_device(wl->primsel, wl->seat);
	} else if(strcmp(interface, wl_compositor_interface.name) == 0) {
		wl->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1);
	} else if(strcmp(interface, xdg_wm_base_interface.name) == 0) {


@@ 573,12 578,8 @@ wlsetcb(Wlwin *wl)
	wl->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);

	if(wl->shm == nil || wl->compositor == nil || wl->xdg_wm_base == nil || wl->seat == nil || wl->decoman == nil || wl->primsel == nil)
		sysfatal("Registration fell short");

	wl->primsel_device = zwp_primary_selection_device_manager_v1_get_device(wl->primsel, wl->seat);
		sysfatal("registration fell short");

	wl->data_device = wl_data_device_manager_get_data_device(wl->data_device_manager, wl->seat);
	wl_data_device_add_listener(wl->data_device, &data_device_listener, wl);
	wlallocbuffer(wl);
	wl->surface = wl_compositor_create_surface(wl->compositor);