Commit be3126a4 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

ozone/wayland: DnD located events must be in px.

Wayland sends all the events in dip, but Chromium expects them
to be in px. Ozone/Wayland has already been translating located
events in px except the dnd located events.

This CL fixes that issue.

Bug: 1044936
Change-Id: I233950227fa641ebc88b7438e3d2ce3f1dc5de60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2014929Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#735228}
parent b76400f7
...@@ -249,7 +249,12 @@ void WaylandSurface::OnDragEnter(const gfx::PointF& point, ...@@ -249,7 +249,12 @@ void WaylandSurface::OnDragEnter(const gfx::PointF& point,
WmDropHandler* drop_handler = GetWmDropHandler(*this); WmDropHandler* drop_handler = GetWmDropHandler(*this);
if (!drop_handler) if (!drop_handler)
return; return;
drop_handler->OnDragEnter(point, std::move(data), operation);
// Wayland sends locations in DIP so they need to be translated to
// physical pixels.
drop_handler->OnDragEnter(
gfx::ScalePoint(point, buffer_scale(), buffer_scale()), std::move(data),
operation);
} }
int WaylandSurface::OnDragMotion(const gfx::PointF& point, int WaylandSurface::OnDragMotion(const gfx::PointF& point,
...@@ -259,7 +264,10 @@ int WaylandSurface::OnDragMotion(const gfx::PointF& point, ...@@ -259,7 +264,10 @@ int WaylandSurface::OnDragMotion(const gfx::PointF& point,
if (!drop_handler) if (!drop_handler)
return 0; return 0;
return drop_handler->OnDragMotion(point, operation); // Wayland sends locations in DIP so they need to be translated to
// physical pixels.
return drop_handler->OnDragMotion(
gfx::ScalePoint(point, buffer_scale(), buffer_scale()), operation);
} }
void WaylandSurface::OnDragDrop(std::unique_ptr<OSExchangeData> data) { void WaylandSurface::OnDragDrop(std::unique_ptr<OSExchangeData> data) {
......
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