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

Unified Diff: ui/events/event.cc

Issue 132123004: Target touches to the correct display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/events/event.h ('k') | ui/events/gestures/gesture_point.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 22e1625add8b3219ee53f93f21ec9fc9d6b6fc6e..936139f8bb6bfa32c3d6462646a22eb02a1c86d4 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -5,6 +5,7 @@
#include "ui/events/event.h"
#if defined(USE_X11)
+#include <X11/extensions/XInput2.h>
#include <X11/Xlib.h>
#endif
@@ -437,7 +438,8 @@ TouchEvent::TouchEvent(const base::NativeEvent& native_event)
radius_x_(GetTouchRadiusX(native_event)),
radius_y_(GetTouchRadiusY(native_event)),
rotation_angle_(GetTouchAngle(native_event)),
- force_(GetTouchForce(native_event)) {
+ force_(GetTouchForce(native_event)),
+ source_device_id_(-1) {
latency()->AddLatencyNumberWithTimestamp(
INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0,
@@ -445,6 +447,12 @@ TouchEvent::TouchEvent(const base::NativeEvent& native_event)
base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()),
1,
true);
+
+#if defined(USE_X11)
+ XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(native_event->xcookie.data);
+ source_device_id_ = xiev->deviceid;
+#endif
+
latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
}
@@ -457,7 +465,8 @@ TouchEvent::TouchEvent(EventType type,
radius_x_(0.0f),
radius_y_(0.0f),
rotation_angle_(0.0f),
- force_(0.0f) {
+ force_(0.0f),
+ source_device_id_(-1) {
latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
}
@@ -475,7 +484,8 @@ TouchEvent::TouchEvent(EventType type,
radius_x_(radius_x),
radius_y_(radius_y),
rotation_angle_(angle),
- force_(force) {
+ force_(force),
+ source_device_id_(-1) {
latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
}
« no previous file with comments | « ui/events/event.h ('k') | ui/events/gestures/gesture_point.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698