summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 01:35:23 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 01:35:23 +0000
commitfb15497e711b3e52428bf8f5e50b901810029f8a (patch)
tree9d2942f4f2c1b59ef3483d844aa044569c1108b3
parent541e3ee0963587f3d4b88554dba80f69c6618a73 (diff)
downloadchromium_src-fb15497e711b3e52428bf8f5e50b901810029f8a.zip
chromium_src-fb15497e711b3e52428bf8f5e50b901810029f8a.tar.gz
chromium_src-fb15497e711b3e52428bf8f5e50b901810029f8a.tar.bz2
Revert 111016 - aura: Re-enable XInput2 events.
It turns out that the position information in an event for a slave device reported by X is always slightly behind than the actual position. However, it turns out that the valuators do contain the correct information. So get the event location from the valuator. BUG=103981 TEST=manually Review URL: http://codereview.chromium.org/8568044 TBR=sadrul@chromium.org Review URL: http://codereview.chromium.org/8624010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111072 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/aura/desktop_host_linux.cc3
-rw-r--r--ui/base/x/events_x.cc19
2 files changed, 5 insertions, 17 deletions
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index 46492cf..2de31e6 100644
--- a/ui/aura/desktop_host_linux.cc
+++ b/ui/aura/desktop_host_linux.cc
@@ -281,8 +281,11 @@ DesktopHostLinux::DesktopHostLinux(const gfx::Rect& bounds)
XSelectInput(xdisplay_, xwindow_, event_mask);
XFlush(xdisplay_);
+ // TODO(sadrul): reenable once 103981 is fixed.
+#if defined(TOUCH_UI)
if (base::MessagePumpForUI::HasXInput2())
ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_);
+#endif
}
DesktopHostLinux::~DesktopHostLinux() {
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index cf2499e..966fec2 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -248,23 +248,8 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
case GenericEvent: {
XIDeviceEvent* xievent =
static_cast<XIDeviceEvent*>(native_event->xcookie.data);
-
- if (xievent->sourceid == xievent->deviceid) {
- // This event is coming from a slave device. Read the position from the
- // valuators, because the events reported for a slave device seems to be
- // behind the master device by one event. See more on crbug.com/103981.
- // The position in the valuators is in the global screen coordinates.
- // But it is necessary to convert it into the window's coordinates.
- // Prepare to be revolted.
- double x = xievent->valuators.values[0] - (xievent->root_x -
- xievent->event_x);
- double y = xievent->valuators.values[1] - (xievent->root_y -
- xievent->event_y);
- return gfx::Point(static_cast<int>(x), static_cast<int>(y));
- } else {
- return gfx::Point(static_cast<int>(xievent->event_x),
- static_cast<int>(xievent->event_y));
- }
+ return gfx::Point(static_cast<int>(xievent->event_x),
+ static_cast<int>(xievent->event_y));
}
}
return gfx::Point();