ref: 8bf59cf80d50154415df2c4fc049b08e1cb4046c
parent: 05c9c55ff13ef53c5033c409064ccaf883cf001a
author: Jacob Moody <[email protected]>
date: Sat Apr 22 04:13:18 EDT 2023
gui-wl: correct seat binding to work with KDE (thanks Keegan)
--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -676,9 +676,6 @@
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) {
@@ -750,6 +747,12 @@
cb = wl_surface_frame(wl->surface);
wl_callback_add_listener(cb, &wl_surface_frame_listener, wl);
+
+ if(wl->data_device_manager != nil && wl->seat != nil){
+ 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);
+ }
}
void