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
376376 static void
377377 seat_handle_name(void *data, struct wl_seat *seat, const char *name)
378378 {
379−
380379 }
381380
382381 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 · 143 unmodified lines
526525 if(strcmp(interface, wl_shm_interface.name) == 0) {
527526 wl->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
528527 } else if(strcmp(interface, wl_seat_interface.name) == 0) {
528+ //We don't support multiseat
529+ if(wl->seat != nil)
530+ return;
529531 wl->seat = wl_registry_bind(registry, name, &wl_seat_interface, 4);
530532 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);
531536 } else if(strcmp(interface, wl_compositor_interface.name) == 0) {
532537 wl->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1);
533538 } else if(strcmp(interface, xdg_wm_base_interface.name) == 0) {
@@ -573,12 +578,8 @@ wlsetcb(Wlwin *wl) · 39 unmodified lines
573578 wl->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
574579
575580 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");
577−
578− wl->primsel_device = zwp_primary_selection_device_manager_v1_get_device(wl->primsel, wl->seat);
581+ sysfatal("registration fell short");
579582
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);
582583 wlallocbuffer(wl);
583584 wl->surface = wl_compositor_create_surface(wl->compositor);
584585

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