Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: ui/ozone/platform/dri/dri_window.cc

Issue 611423002: [WIP][Ozone] Support external touchscreens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone-touchscreen
Patch Set: . Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/native_display_delegate_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/native_display_delegate_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698