diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-27 20:49:17 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-27 20:49:17 +0000 |
commit | d5bdab63fd2d7c3195de86d7c9f69b9d91b23beb (patch) | |
tree | 5b93ea49dbc6f1de7069ee89757ce4a541d9a6b9 /win8 | |
parent | de894b004fd9c1aa21ed9cbcf13c7fe463714739 (diff) | |
download | chromium_src-d5bdab63fd2d7c3195de86d7c9f69b9d91b23beb.zip chromium_src-d5bdab63fd2d7c3195de86d7c9f69b9d91b23beb.tar.gz chromium_src-d5bdab63fd2d7c3195de86d7c9f69b9d91b23beb.tar.bz2 |
Support multi touch on Windows 8 AURA and ASH.
The touch events coming in from desktop chrome AURA and ASH have hardcoded touch ids
which breaks the gesture recognizer as it is unable to figure out that multiple touch points
are involved.
Fix on desktop Chrome AURA is to use the OS generated touch id mapped to the gesture recognizer range.
For ASH Windows 8 we pass in the mapped touch ids from the metro driver in the touch IPC messages.
Fixes bug https://code.google.com/p/chromium/issues/detail?id=179977
BUG=179977
R=cpu,sky
Review URL: https://codereview.chromium.org/13003004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191015 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index 56c9afb..ec59ba1 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -19,6 +19,7 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_sender.h" +#include "ui/base/gestures/gesture_sequence.h" #include "ui/metro_viewer/metro_viewer_messages.h" #include "win8/metro_driver/file_picker_ash.h" #include "win8/metro_driver/metro_driver.h" @@ -145,7 +146,8 @@ class PointerInfoHandler { y_(0), wheel_delta_(0), update_kind_(winui::Input::PointerUpdateKind_Other), - timestamp_(0) {} + timestamp_(0), + pointer_id_(0) {} HRESULT Init(winui::Core::IPointerEventArgs* args) { HRESULT hr = args->get_CurrentPoint(&pointer_point_); @@ -169,10 +171,13 @@ class PointerInfoHandler { hr = properties->get_MouseWheelDelta(&wheel_delta_); if (FAILED(hr)) return hr; - x_ = point.X; y_ = point.Y; pointer_point_->get_Timestamp(×tamp_); + pointer_point_->get_PointerId(&pointer_id_); + // Map the OS touch event id to a range allowed by the gesture recognizer. + if (IsTouch()) + pointer_id_ %= ui::GestureSequence::kMaxGesturePoints; return S_OK; } @@ -218,12 +223,17 @@ class PointerInfoHandler { int x() const { return x_; } int y() const { return y_; } + uint32 pointer_id() const { + return pointer_id_; + } + uint64 timestamp() const { return timestamp_; } private: int x_; int y_; int wheel_delta_; + uint32 pointer_id_; winui::Input::PointerUpdateKind update_kind_; mswr::ComPtr<winui::Input::IPointerPoint> pointer_point_; uint64 timestamp_; @@ -548,7 +558,8 @@ HRESULT ChromeAppViewAsh::OnPointerMoved(winui::Core::ICoreWindow* sender, DCHECK(pointer.IsTouch()); ui_channel_->Send(new MetroViewerHostMsg_TouchMoved(pointer.x(), pointer.y(), - pointer.timestamp())); + pointer.timestamp(), + pointer.pointer_id())); } return S_OK; } @@ -577,7 +588,8 @@ HRESULT ChromeAppViewAsh::OnPointerPressed( DCHECK(pointer.IsTouch()); ui_channel_->Send(new MetroViewerHostMsg_TouchDown(pointer.x(), pointer.y(), - pointer.timestamp())); + pointer.timestamp(), + pointer.pointer_id())); } return S_OK; } @@ -601,7 +613,8 @@ HRESULT ChromeAppViewAsh::OnPointerReleased( DCHECK(pointer.IsTouch()); ui_channel_->Send(new MetroViewerHostMsg_TouchUp(pointer.x(), pointer.y(), - pointer.timestamp())); + pointer.timestamp(), + pointer.pointer_id())); } return S_OK; } |