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>
dev
Harish Krupo 6 years ago
parent 737ac0d4b3
commit 43152a3a8f
  1. 5
      clients/window.c

@ -3922,8 +3922,9 @@ offer_io_func(struct task *task, uint32_t events)
offer->x, offer->y, offer->user_data); offer->x, offer->y, offer->user_data);
if (len == 0) { if (len == 0) {
if (display->data_device_manager_version >= if ((offer != offer->input->selection_offer) &&
WL_DATA_OFFER_FINISH_SINCE_VERSION) (display->data_device_manager_version >=
WL_DATA_OFFER_FINISH_SINCE_VERSION))
wl_data_offer_finish(offer->offer); wl_data_offer_finish(offer->offer);
close(offer->fd); close(offer->fd);
data_offer_destroy(offer); data_offer_destroy(offer);

Loading…
Cancel
Save