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 /ui | |
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 'ui')
-rw-r--r-- | ui/aura/remote_root_window_host_win.cc | 22 | ||||
-rw-r--r-- | ui/aura/remote_root_window_host_win.h | 6 | ||||
-rw-r--r-- | ui/metro_viewer/metro_viewer_messages.h | 15 | ||||
-rw-r--r-- | ui/views/win/hwnd_message_handler.cc | 7 |
4 files changed, 27 insertions, 23 deletions
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc index ae50ced..16cbdb6 100644 --- a/ui/aura/remote_root_window_host_win.cc +++ b/ui/aura/remote_root_window_host_win.cc @@ -27,9 +27,6 @@ namespace { const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; -// The touch id to be used for touch events coming in from Windows Ash. -const int kRemoteWindowTouchId = 10; - // Sets the keystate for the virtual key passed in to down or up. void SetKeyState(uint8* key_states, bool key_down, uint32 virtual_key_code) { DCHECK(key_states); @@ -373,28 +370,35 @@ void RemoteRootWindowHostWin::OnVisibilityChanged(bool visible) { delegate_->OnHostActivated(); } -void RemoteRootWindowHostWin::OnTouchDown(int32 x, int32 y, uint64 timestamp) { +void RemoteRootWindowHostWin::OnTouchDown(int32 x, + int32 y, + uint64 timestamp, + uint32 pointer_id) { ui::TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(x, y), - kRemoteWindowTouchId, + pointer_id, base::TimeDelta::FromMicroseconds(timestamp)); delegate_->OnHostTouchEvent(&event); } -void RemoteRootWindowHostWin::OnTouchUp(int32 x, int32 y, uint64 timestamp) { +void RemoteRootWindowHostWin::OnTouchUp(int32 x, + int32 y, + uint64 timestamp, + uint32 pointer_id) { ui::TouchEvent event(ui::ET_TOUCH_RELEASED, gfx::Point(x, y), - kRemoteWindowTouchId, + pointer_id, base::TimeDelta::FromMicroseconds(timestamp)); delegate_->OnHostTouchEvent(&event); } void RemoteRootWindowHostWin::OnTouchMoved(int32 x, int32 y, - uint64 timestamp) { + uint64 timestamp, + uint32 pointer_id) { ui::TouchEvent event(ui::ET_TOUCH_MOVED, gfx::Point(x, y), - kRemoteWindowTouchId, + pointer_id, base::TimeDelta::FromMicroseconds(timestamp)); delegate_->OnHostTouchEvent(&event); } diff --git a/ui/aura/remote_root_window_host_win.h b/ui/aura/remote_root_window_host_win.h index 61494ff..eb094b0 100644 --- a/ui/aura/remote_root_window_host_win.h +++ b/ui/aura/remote_root_window_host_win.h @@ -127,9 +127,9 @@ class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { uint32 scan_code, uint32 flags); void OnVisibilityChanged(bool visible); - void OnTouchDown(int32 x, int32 y, uint64 timestamp); - void OnTouchUp(int32 x, int32 y, uint64 timestamp); - void OnTouchMoved(int32 x, int32 y, uint64 timestamp); + void OnTouchDown(int32 x, int32 y, uint64 timestamp, uint32 pointer_id); + void OnTouchUp(int32 x, int32 y, uint64 timestamp, uint32 pointer_id); + void OnTouchMoved(int32 x, int32 y, uint64 timestamp, uint32 pointer_id); void OnFileSaveAsDone(bool success, string16 filename, int filter_index); diff --git a/ui/metro_viewer/metro_viewer_messages.h b/ui/metro_viewer/metro_viewer_messages.h index fd2c5a6..53ee112 100644 --- a/ui/metro_viewer/metro_viewer_messages.h +++ b/ui/metro_viewer/metro_viewer_messages.h @@ -54,18 +54,21 @@ IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_Character, IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_VisibilityChanged, bool /* visible */); -IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchDown, +IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_TouchDown, int32, /* x-coordinate */ int32, /* y-coordinate */ - uint64) /* timestamp */ -IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchUp, + uint64, /* timestamp */ + uint32) /* pointer_id */ +IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_TouchUp, int32, /* x-coordinate */ int32, /* y-coordinate */ - uint64) /* timestamp */ -IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchMoved, + uint64, /* timestamp */ + uint32) /* pointer_id */ +IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_TouchMoved, int32, /* x-coordinate */ int32, /* y-coordinate */ - uint64) /* timestamp */ + uint64, /* timestamp */ + uint32) /* pointer_id */ // Informs the browser of the result of a file save as operation. IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_FileSaveAsDone, diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc index dc6632d..e40acd0 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -12,6 +12,7 @@ #include "base/win/windows_version.h" #include "ui/base/events/event.h" #include "ui/base/events/event_utils.h" +#include "ui/base/gestures/gesture_sequence.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "ui/base/win/hwnd_util.h" #include "ui/base/win/mouse_wheel_util.h" @@ -292,10 +293,6 @@ bool ProcessChildWindowMessage(UINT message, // The thickness of an auto-hide taskbar in pixels. const int kAutoHideTaskbarThicknessPx = 2; -// The touch id to be used for touch events coming in from Windows Aura -// Desktop. -const int kDesktopChromeAuraTouchId = 9; - // For windows with the standard frame removed, the client area needs to be // different from the window area to avoid a "feature" in Windows's handling of // WM_NCCALCSIZE data. See the comment near the bottom of GetClientAreaInsets @@ -2003,7 +2000,7 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, ui::TouchEvent event( touch_event_type, gfx::Point(point.x, point.y), - kDesktopChromeAuraTouchId, + input[i].dwID % ui::GestureSequence::kMaxGesturePoints, base::TimeDelta::FromMilliseconds(input[i].dwTime)); delegate_->HandleTouchEvent(event); } |