History

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.

Jacob Moody committed 4 years ago

Commit a8a4b241 parent 6b448b91 file · +7 −6Browse files

Unified · Split

gui-wl/wl-cb.c+7−6
@@ -376,7 +376,6 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, uint32_t capabilities · 375 unmodified lines
376static void376static void
377seat_handle_name(void *data, struct wl_seat *seat, const char *name)377seat_handle_name(void *data, struct wl_seat *seat, const char *name)
378{378{
379
380}379}
381 380
382static const struct wl_seat_listener seat_listener = {381static const struct wl_seat_listener seat_listener = {
@@ -526,8 +525,14 @@ handle_global(void *data, struct wl_registry *registry, uint32_t name, const cha · 143 unmodified lines
526 if(strcmp(interface, wl_shm_interface.name) == 0) {525 if(strcmp(interface, wl_shm_interface.name) == 0) {
527 wl->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);526 wl->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
528 } else if(strcmp(interface, wl_seat_interface.name) == 0) {527 } else if(strcmp(interface, wl_seat_interface.name) == 0) {
528 //We don't support multiseat
529 if(wl->seat != nil)
530 return;
529 wl->seat = wl_registry_bind(registry, name, &wl_seat_interface, 4);531 wl->seat = wl_registry_bind(registry, name, &wl_seat_interface, 4);
530 wl_seat_add_listener(wl->seat, &seat_listener, wl);532 wl_seat_add_listener(wl->seat, &seat_listener, wl);
533 wl->data_device = wl_data_device_manager_get_data_device(wl->data_device_manager, wl->seat);
534 wl_data_device_add_listener(wl->data_device, &data_device_listener, wl);
535 wl->primsel_device = zwp_primary_selection_device_manager_v1_get_device(wl->primsel, wl->seat);
531 } else if(strcmp(interface, wl_compositor_interface.name) == 0) {536 } else if(strcmp(interface, wl_compositor_interface.name) == 0) {
532 wl->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1);537 wl->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1);
533 } else if(strcmp(interface, xdg_wm_base_interface.name) == 0) {538 } else if(strcmp(interface, xdg_wm_base_interface.name) == 0) {
@@ -573,12 +578,8 @@ wlsetcb(Wlwin *wl) · 39 unmodified lines
573 wl->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);578 wl->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
574 579
575 if(wl->shm == nil || wl->compositor == nil || wl->xdg_wm_base == nil || wl->seat == nil || wl->decoman == nil || wl->primsel == nil)580 if(wl->shm == nil || wl->compositor == nil || wl->xdg_wm_base == nil || wl->seat == nil || wl->decoman == nil || wl->primsel == nil)
576 sysfatal("Registration fell short");581 sysfatal("registration fell short");
577
578 wl->primsel_device = zwp_primary_selection_device_manager_v1_get_device(wl->primsel, wl->seat);
579 582
580 wl->data_device = wl_data_device_manager_get_data_device(wl->data_device_manager, wl->seat);
581 wl_data_device_add_listener(wl->data_device, &data_device_listener, wl);
582 wlallocbuffer(wl);583 wlallocbuffer(wl);
583 wl->surface = wl_compositor_create_surface(wl->compositor);584 wl->surface = wl_compositor_create_surface(wl->compositor);
584 585

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t