Commit 37f6816c authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

exo: Properly handle D&D when no icon is specified

In the standard Wayland protocol, null should be allowed for the icon
argument of wl_data_device::start_drag. However, when nullptr was passed
to the |icon| of DragDropOperation, ScheduleStartDragDropOperation would
never be called, because couter_ assumed the icon was always present.
This CL fixes that issue.

TEST=manual
BUG=b:64963392

Change-Id: Ibb504096c31ed6e0048c6fcf7038190db9498fd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2143177
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarFergus Dall <sidereal@google.com>
Cr-Commit-Position: refs/heads/master@{#758708}
parent d673e671
...@@ -114,9 +114,9 @@ DragDropOperation::DragDropOperation( ...@@ -114,9 +114,9 @@ DragDropOperation::DragDropOperation(
base::BindOnce(&DragDropOperation::ScheduleStartDragDropOperation, base::BindOnce(&DragDropOperation::ScheduleStartDragDropOperation,
weak_ptr_factory_.GetWeakPtr()); weak_ptr_factory_.GetWeakPtr());
// Make the count kMaxClipboardDataTypes + 1 so we can wait for the icon to be // When the icon is present, make the count kMaxClipboardDataTypes + 1 so we
// captured as well. // can wait for the icon to be captured as well.
counter_ = base::BarrierClosure(kMaxClipboardDataTypes + 1, counter_ = base::BarrierClosure(kMaxClipboardDataTypes + (icon ? 1 : 0),
std::move(start_op_callback)); std::move(start_op_callback));
source->GetDataForPreferredMimeTypes( source->GetDataForPreferredMimeTypes(
......
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