diff --git a/clients/dnd.c b/clients/dnd.c
index d0f20811..d5594ff1 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -271,9 +271,16 @@ drag_finish(void *data, struct wl_drag *drag, int fd)
free(dnd_drag);
}
+static void
+drag_reject(void *data, struct wl_drag *drag)
+{
+ fprintf(stderr, "drop rejected\n");
+}
+
static const struct wl_drag_listener drag_listener = {
drag_target,
- drag_finish
+ drag_finish,
+ drag_reject
};
static void
@@ -379,10 +386,7 @@ drag_offer_drop(void *data, struct wl_drag_offer *offer)
if (!dnd_offer->drag_type) {
fprintf(stderr, "got 'drop', but no target\n");
- /* FIXME: Should send response so compositor and
- * source knows it's over. Can't send -1 to indicate
- * 'no target' though becauses of the way fd passing
- * currently works. */
+ wl_drag_offer_reject(offer);
return;
}
diff --git a/compositor/compositor.c b/compositor/compositor.c
index cbb0b6b1..f993bf63 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -1137,9 +1137,19 @@ drag_offer_receive(struct wl_client *client,
close(fd);
}
+static void
+drag_offer_reject(struct wl_client *client, struct wl_drag_offer *offer)
+{
+ struct wl_drag *drag = container_of(offer, struct wl_drag, drag_offer);
+
+ wl_client_post_event(drag->source->client, &drag->resource.base,
+ WL_DRAG_REJECT);
+}
+
static const struct wl_drag_offer_interface drag_offer_interface = {
drag_offer_accept,
- drag_offer_receive
+ drag_offer_receive,
+ drag_offer_reject
};
static void
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 24c53c29..77ff8f80 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -209,6 +209,8 @@
+
+
@@ -226,6 +228,9 @@
+
+
+