| Index: ui/ozone/platform/dri/dri_window.cc
|
| diff --git a/ui/ozone/platform/dri/dri_window.cc b/ui/ozone/platform/dri/dri_window.cc
|
| index a5cee6b20e4d588987f88ee60b3b596edf119995..ee40da3b7490be9eac27f92167238e1537958ffa 100644
|
| --- a/ui/ozone/platform/dri/dri_window.cc
|
| +++ b/ui/ozone/platform/dri/dri_window.cc
|
| @@ -125,20 +125,27 @@ bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
|
| // DriWindow. We cannot check the event's location because if the
|
| // touchscreen has a bezel, touches in the bezel have a location outside of
|
| // |bounds_|.
|
| - int64_t display_id =
|
| + gfx::Display display =
|
| DeviceDataManager::GetInstance()->GetDisplayForTouchDevice(
|
| event->source_device_id());
|
|
|
| - if (display_id == gfx::Display::kInvalidDisplayID)
|
| + if (display.id() == gfx::Display::kInvalidDisplayID)
|
| return false;
|
|
|
| - DisplaySnapshot* snapshot = display_manager_->GetDisplay(display_id);
|
| + // If |display| is mirroring another display's content, touches should be
|
| + // dispatched to that display.
|
| + int64_t touch_display_id =
|
| + display.mirrored_display_id() == gfx::Display::kInvalidDisplayID
|
| + ? display.id()
|
| + : display.mirrored_display_id();
|
| +
|
| + DisplaySnapshot* snapshot = display_manager_->GetDisplay(touch_display_id);
|
| if (!snapshot || !snapshot->current_mode())
|
| return false;
|
|
|
| - gfx::Rect display_bounds(snapshot->origin(),
|
| - snapshot->current_mode()->size());
|
| - return display_bounds == bounds_;
|
| + gfx::Rect touch_display_bounds(snapshot->origin(),
|
| + snapshot->current_mode()->size());
|
| + return touch_display_bounds == bounds_;
|
| } else if (event->IsLocatedEvent()) {
|
| LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
|
| return bounds_.Contains(gfx::ToFlooredPoint(located_event->location()));
|
|
|