New drag and drop / selection protocol

This commit brings a big change to the DND and copy/paste interfaces.
Most importantly the functionality is now independent of wl_shell.
The wl_shell interface is intended for desktop style UI interaction and
an optional and experimental interface.

The new interface also allows receiving the DND data multiple times or
multiple times during the drag, and the mechanism for offering and receiving
data is now shared between DND and selections.
This commit is contained in:
Kristian Høgsberg 2011-11-15 08:58:34 -05:00
parent 0b7d1e86af
commit eae3bcb4cc
5 changed files with 132 additions and 193 deletions

View file

@ -449,7 +449,7 @@ wl_connection_vmarshal(struct wl_connection *connection,
closure->types[i] = &ffi_type_uint32;
closure->args[i] = p;
object = va_arg(ap, struct wl_object *);
*p++ = object->id;
*p++ = object ? object->id : 0;
break;
case 'a':
@ -493,6 +493,8 @@ wl_connection_vmarshal(struct wl_connection *connection,
&dup_fd, sizeof dup_fd);
break;
default:
fprintf(stderr, "unhandled format code: '%c'\n",
message->signature[i - 2]);
assert(0);
break;
}
@ -632,7 +634,7 @@ wl_connection_demarshal(struct wl_connection *connection,
closure->types[i] = &ffi_type_uint32;
closure->args[i] = p;
object = wl_map_lookup(objects, *p);
if (*p == 0 || object != NULL) {
if (object != NULL) {
printf("not a new object (%d), "
"message %s(%s)\n",
*p, message->name, message->signature);