Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10454082: Ignore (fake) mouse events that are created during a touch (iff we will handle the touch elsewhere.) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Whitespace cleanup. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_win.cc
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 77f45164a303db0d0f8e05e2c14d65f92c559236..a4c049ffb74690fe3be9c5456f2c8f8a2127a1dc 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -64,6 +64,9 @@
#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 content::BrowserThread;
@@ -1796,6 +1799,15 @@ LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam,
LPARAM lparam, BOOL& handled) {
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_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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698