diff options
author | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 14:00:28 +0000 |
---|---|---|
committer | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 14:00:28 +0000 |
commit | 970c05c9c07555b28125c63c85b0c53bcdfcc03f (patch) | |
tree | f9a9f1bf72017038bfa0aa47825b4fd77d4b30f2 /content | |
parent | 6623b64b946445797d430f85cc23c48e94cc4383 (diff) | |
download | chromium_src-970c05c9c07555b28125c63c85b0c53bcdfcc03f.zip chromium_src-970c05c9c07555b28125c63c85b0c53bcdfcc03f.tar.gz chromium_src-970c05c9c07555b28125c63c85b0c53bcdfcc03f.tar.bz2 |
Correct behaviour of touch wrt mouse capture.
We short circuit emulated mouse events (they are emulated on a touch) so
that these events don't get passed to javascript. The short circuit logic
also short-circuited the mouse capture/release logic, which caused failure
when touch happened during a mouse-capture.
This commit ensures that only the call to ForwardMouseEvent is short-
circuited for emulated events.
BUG=132068
TEST=
Review URL: https://chromiumcodereview.appspot.com/10802085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_win.cc | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index f085437..bab322b 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -66,9 +66,6 @@ #include "webkit/plugins/npapi/webplugin.h" #include "webkit/plugins/npapi/webplugin_delegate_impl.h" -// From MSDN. -#define MOUSEEVENTF_FROMTOUCH 0xFF515700 - using base::TimeDelta; using base::TimeTicks; using ui::ViewProp; @@ -1872,15 +1869,6 @@ LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam, TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnMouseEvent"); handled = TRUE; - // Windows sends (fake) mouse messages for touch events. Ignore these since - // we're processing WM_TOUCH elsewhere. - if (touch_events_enabled_ && (message == WM_MOUSEMOVE || - message == WM_LBUTTONDOWN || message == WM_LBUTTONUP || - message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) && - (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == - MOUSEEVENTF_FROMTOUCH) - return 0; - if (message == WM_MOUSELEAVE) ignore_mouse_movement_ = true; @@ -2934,9 +2922,13 @@ void RenderWidgetHostViewWin::ForwardMouseEventToRenderer(UINT message, last_mouse_position_.unlocked_global.SetPoint(event.globalX, event.globalY); } - // Send the event to the renderer before changing mouse capture, so that the - // capturelost event arrives after mouseup. - render_widget_host_->ForwardMouseEvent(event); + // Windows sends (fake) mouse messages for touch events. Don't send these to + // the render widget. + if (!touch_events_enabled_ || !ui::IsMouseEventFromTouch(message)) { + // Send the event to the renderer before changing mouse capture, so that + // the capturelost event arrives after mouseup. + render_widget_host_->ForwardMouseEvent(event); + } switch (event.type) { case WebInputEvent::MouseMove: |