summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 02:03:54 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 02:03:54 +0000
commitea7f83787239ae91db4ec297225905b0c8a5a595 (patch)
treef8ca1429c85e3139e561064791d34accd2aa25a3 /ui/aura
parentca8ceaa180917272404e2de7752a2052bd2dbfbf (diff)
downloadchromium_src-ea7f83787239ae91db4ec297225905b0c8a5a595.zip
chromium_src-ea7f83787239ae91db4ec297225905b0c8a5a595.tar.gz
chromium_src-ea7f83787239ae91db4ec297225905b0c8a5a595.tar.bz2
x11: Add a hack to detect touch-cancel events from X11.
The touch-end event chrome receives from X does not contain enough information to know whether the event came because the user lifted the finger, or something else happened in the system that triggered the event. So add some hack to figure out whether to generate a touch-release event or a touch-cancel event from the X touch-end event. BUG=169177 Review URL: https://codereview.chromium.org/11819054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/root_window.cc6
-rw-r--r--ui/aura/root_window_host_linux.cc1
2 files changed, 6 insertions, 1 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index d79c6ec..2449873 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -803,7 +803,11 @@ bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) {
Env::GetInstance()->set_touch_down(touch_ids_down_ != 0);
break;
- // Don't handle ET_TOUCH_CANCELLED since we always get a ET_TOUCH_RELEASED.
+ // Handle ET_TOUCH_CANCELLED only if it has a native event.
+ case ui::ET_TOUCH_CANCELLED:
+ if (!event->HasNativeEvent())
+ break;
+ // fallthrough
case ui::ET_TOUCH_RELEASED:
touch_ids_down_ = (touch_ids_down_ | (1 << event->touch_id())) ^
(1 << event->touch_id());
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index c15fad9..e3ececa 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -868,6 +868,7 @@ void RootWindowHostLinux::DispatchXI2Event(const base::NativeEvent& event) {
xev = &last_event;
// fallthrough
case ui::ET_TOUCH_PRESSED:
+ case ui::ET_TOUCH_CANCELLED:
case ui::ET_TOUCH_RELEASED: {
ui::TouchEvent touchev(xev);
#if defined(OS_CHROMEOS)