summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 18:21:53 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 18:21:53 +0000
commite2aa6065bcc3a1b513112de842ec785b5a8a2a0b (patch)
treebdbc8ad3a8c10cc617db5234b1b021d3e300605d
parent15092cdf644ea3fe116b3a4309426b4da2471ebd (diff)
downloadchromium_src-e2aa6065bcc3a1b513112de842ec785b5a8a2a0b.zip
chromium_src-e2aa6065bcc3a1b513112de842ec785b5a8a2a0b.tar.gz
chromium_src-e2aa6065bcc3a1b513112de842ec785b5a8a2a0b.tar.bz2
Context menu on RMB-down, not up, on Linux.
Review URL: http://codereview.chromium.org/60017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12963 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webview_impl.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index e0247e3..492d0c3 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -460,11 +460,16 @@ void WebViewImpl::MouseDown(const WebMouseEvent& event) {
ShowAutofillForNode(clicked_node.get());
}
-#if defined(OS_MACOSX)
// Dispatch the contextmenu event regardless of if the click was swallowed.
+ // On Windows, we handle it on mouse up, not down.
+#if defined(OS_MACOSX)
if (event.button == WebMouseEvent::ButtonRight ||
(event.button == WebMouseEvent::ButtonLeft &&
- event.modifiers & WebMouseEvent::ControlKey))
+ event.modifiers & WebMouseEvent::ControlKey)) {
+ MouseContextMenu(event);
+ }
+#elif defined(OS_LINUX)
+ if (event.button == WebMouseEvent::ButtonRight)
MouseContextMenu(event);
#endif
}
@@ -504,8 +509,9 @@ void WebViewImpl::MouseUp(const WebMouseEvent& event) {
main_frame()->frame()->eventHandler()->handleMouseReleaseEvent(
MakePlatformMouseEvent(main_frame()->frameview(), event));
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN)
// Dispatch the contextmenu event regardless of if the click was swallowed.
+ // On Mac/Linux, we handle it on mouse down, not up.
if (event.button == WebMouseEvent::ButtonRight)
MouseContextMenu(event);
#endif