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

Unified Diff: ui/events/x/events_x.cc

Issue 191223007: Move touch CTM from X into Chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move CTM update code into a separate file ash/touch/touch_ctm_controller.cc Created 6 years, 9 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
« ui/events/x/device_data_manager.cc ('K') | « ui/events/x/device_data_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x.cc
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc
index 9fec9df2bf9bcf18d5f9947a3d96e0c4229a8662..1ab01710573a881e01fd80015f843f12a3a4fcc5 100644
--- a/ui/events/x/events_x.cc
+++ b/ui/events/x/events_x.cc
@@ -434,8 +434,24 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
case GenericEvent: {
XIDeviceEvent* xievent =
static_cast<XIDeviceEvent*>(native_event->xcookie.data);
- return gfx::Point(static_cast<int>(xievent->event_x),
- static_cast<int>(xievent->event_y));
+ float x = xievent->event_x;
+ float y = xievent->event_y;
+#if defined(OS_CHROMEOS)
+ ui::EventType type = ui::EventTypeFromNative(native_event);
+ switch (type) {
sadrul 2014/03/15 19:32:51 Let's do this for xievent->evtype == XI_Touch* eve
Yufeng Shen (Slow to review) 2014/04/29 20:34:18 Done.
+ case ui::ET_TOUCH_MOVED:
+ case ui::ET_TOUCH_PRESSED:
+ case ui::ET_TOUCH_CANCELLED:
+ case ui::ET_TOUCH_RELEASED: {
+ ui::DeviceDataManager::GetInstance()->ApplyTouchCTM(
+ xievent->deviceid, &x, &y);
+ break;
+ }
+ default:
+ break;
+ }
+#endif // defined(OS_CHROMEOS)
+ return gfx::Point(static_cast<int>(x), static_cast<int>(y));
}
}
return gfx::Point();
« ui/events/x/device_data_manager.cc ('K') | « ui/events/x/device_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698