aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-16 08:56:59 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-16 08:56:59 -0400
commitc0e8585a4cd3ef5b9616efa2f61fe5b029c5d147 (patch)
treec9a7e892103f3fccc8d2094e96a0f63635ae251b
parentb8de0a29b4f53700eef40edc76653ff318bbcf89 (diff)
data-device: handle multiple data devices
-rw-r--r--types/wlr_data_device.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/types/wlr_data_device.c b/types/wlr_data_device.c
index 6616c338..3fcd5873 100644
--- a/types/wlr_data_device.c
+++ b/types/wlr_data_device.c
@@ -652,8 +652,12 @@ void data_device_manager_get_data_device(struct wl_client *client,
return;
}
- // TODO handle a seat handle having multiple data devices
- assert(handle->data_device == NULL);
+ if (handle->data_device != NULL) {
+ // XXX this is probably a protocol violation, but it simplfies our code
+ // and it's stupid to create several data devices for the same seat.
+ wl_resource_destroy(handle->data_device);
+ }
+
handle->data_device = resource;
wl_resource_set_implementation(resource, &data_device_impl,