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 <harishkrupo@gmail.com>
This commit is contained in:
Harish Krupo 2019-04-19 22:06:44 +05:30
parent 737ac0d4b3
commit 43152a3a8f

View File

@ -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);