Commit 8ce7f410 authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

ozone/wayland: dnd: Destroy offer when data transfer finishes

Some compositors, including Exo, wait for the drag offer to be finished
and destroyed before deciding when and whether to send dnd_finished or
cancelled events [1]. This was not being done in ozone/wayland data drag
controller, which led to dnd operations appear to be cancelled while
they actually succeeded, affecting both lacros and linux desktop chrome.
This patch fixes it by ensuring the offer is destroyed just after finish
request for it is sent.

Bug: 1141959

[1] https://source.chromium.org/chromium/chromium/src/+/master:components/exo/data_device.cc;l=133-144;drc=cbf5f453d15bf1a934dc0c8c479d9cffdb4261df

R=msisov@igalia.com

Change-Id: I2efed6b7035a654f618a077d13f03156a376b71e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545647Reviewed-by: default avatarMaksim Sisov (GMT+2) <msisov@igalia.com>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Maksim Sisov (GMT+2) <msisov@igalia.com>
Auto-Submit: Nick Yamane <nickdiego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#828621}
parent d16fee6b
...@@ -314,9 +314,14 @@ void WaylandDataDragController::OnMimeTypeDataTransferred( ...@@ -314,9 +314,14 @@ void WaylandDataDragController::OnMimeTypeDataTransferred(
void WaylandDataDragController::OnDataTransferFinished( void WaylandDataDragController::OnDataTransferFinished(
std::unique_ptr<OSExchangeData> received_data) { std::unique_ptr<OSExchangeData> received_data) {
data_offer_->FinishOffer();
window_->OnDragDrop(std::move(received_data)); window_->OnDragDrop(std::move(received_data));
// Offer must be finished and destroyed here as some compositors may delay to
// send wl_data_source::finished|cancelled until owning client destroys the
// drag offer. e.g: Exosphere.
data_offer_->FinishOffer();
data_offer_.reset();
unprocessed_mime_types_.clear(); unprocessed_mime_types_.clear();
state_ = State::kIdle; state_ = State::kIdle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment