toytoolkit assumes wl_seat-s are announced after the wl_data_device_manager
registry_handle_global()
handles wl_seat
s and the wl_data_device_manager
like this:
} else if (strcmp(interface, "wl_seat") == 0) {
display_add_input(d, id, version);
} else /*...*/ if (strcmp(interface, "wl_data_device_manager") == 0) {
d->data_device_manager_version = MIN(version, 3);
d->data_device_manager =
wl_registry_bind(registry, id,
&wl_data_device_manager_interface,
d->data_device_manager_version);
}
while display_add_input()
does this:
if (d->data_device_manager) {
input->data_device =
wl_data_device_manager_get_data_device(d->data_device_manager,
input->seat);
wl_data_device_add_listener(input->data_device,
&data_device_listener,
input);
}
So, in case the registry happens to announce wl_data_device_manager
after a wl_seat
, that seat ends up unable to copy/paste/drag-n-drop.
Weston does this:
$ weston-info | egrep 'data|seat'
interface: 'wl_data_device_manager', version: 3, name: 8
interface: 'wl_seat', version: 5, name: 10
and Mutter this:
$ weston-info | egrep 'data|seat'
interface: 'wl_data_device_manager', version: 3, name: 7
interface: 'wl_seat', version: 5, name: 16
name: seat0
which is probably why this bug has gone unnoticed
Edited by Sergey Bugaev