| 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 cce1dd63de19aafb2bebb63379dcef613ce4faf5..4d5a614104f889fc221bdb4b2488a00944b79849 100644
|
| --- a/ui/ozone/platform/dri/dri_window.cc
|
| +++ b/ui/ozone/platform/dri/dri_window.cc
|
| @@ -21,13 +21,15 @@ DriWindow::DriWindow(PlatformWindowDelegate* delegate,
|
| const gfx::Rect& bounds,
|
| DriGpuPlatformSupportHost* sender,
|
| EventFactoryEvdev* event_factory,
|
| - DriWindowManager* window_manager)
|
| + DriWindowManager* window_manager,
|
| + DisplayManager* display_manager)
|
| : delegate_(delegate),
|
| sender_(sender),
|
| event_factory_(event_factory),
|
| window_manager_(window_manager),
|
| bounds_(bounds),
|
| - widget_(window_manager->NextAcceleratedWidget()) {
|
| + widget_(window_manager->NextAcceleratedWidget()),
|
| + touch_converter_(this, display_manager) {
|
| window_manager_->AddWindow(widget_, this);
|
| }
|
|
|
| @@ -57,6 +59,7 @@ void DriWindow::Close() {}
|
| void DriWindow::SetBounds(const gfx::Rect& bounds) {
|
| bounds_ = bounds;
|
| delegate_->OnBoundsChanged(bounds);
|
| + touch_converter_.UpdateTransform();
|
|
|
| if (!sender_->IsConnected())
|
| return;
|
| @@ -100,10 +103,18 @@ bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
|
| if (event->IsMouseEvent() || event->IsScrollEvent())
|
| return window_manager_->cursor()->GetCursorWindow() == widget_;
|
|
|
| + if (event->IsTouchEvent())
|
| + return touch_converter_.CanHandleEvent(*static_cast<TouchEvent*>(event));
|
| +
|
| return true;
|
| }
|
|
|
| uint32_t DriWindow::DispatchEvent(const PlatformEvent& native_event) {
|
| + DCHECK(native_event);
|
| + Event* event = static_cast<Event*>(native_event);
|
| + if (event->IsTouchEvent())
|
| + touch_converter_.RewriteTouchEvent(static_cast<TouchEvent*>(event));
|
| +
|
| DispatchEventFromNativeUiEvent(
|
| native_event,
|
| base::Bind(&PlatformWindowDelegate::DispatchEvent,
|
|
|