From 43152a3a8fa1e3164db33ac7ace105186c5e8ac8 Mon Sep 17 00:00:00 2001 From: Harish Krupo Date: Fri, 19 Apr 2019 22:06:44 +0530 Subject: [PATCH] Fix: clients/window: Premature finish request when copy-pasting As per the wl_data_offer::finish documentation, the request is only valid for drag n drop operations and signifies that a dnd is completed. Send finish request only when we have a dnd operation active. Signed-off-by: Harish Krupo --- clients/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/window.c b/clients/window.c index 92b545dd..d4dc96e1 100644 --- a/clients/window.c +++ b/clients/window.c @@ -3922,8 +3922,9 @@ offer_io_func(struct task *task, uint32_t events) offer->x, offer->y, offer->user_data); if (len == 0) { - if (display->data_device_manager_version >= - WL_DATA_OFFER_FINISH_SINCE_VERSION) + if ((offer != offer->input->selection_offer) && + (display->data_device_manager_version >= + WL_DATA_OFFER_FINISH_SINCE_VERSION)) wl_data_offer_finish(offer->offer); close(offer->fd); data_offer_destroy(offer);