summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 00:11:48 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 00:11:48 +0000
commitcfdae27555853c2c57f7aa91179bc39407dc77bc (patch)
treead892472e54aa0e27ba89102209aa126cd2821a0
parent32646ea966566daff8346e09236ffa8e4a9cdf35 (diff)
downloadchromium_src-cfdae27555853c2c57f7aa91179bc39407dc77bc.zip
chromium_src-cfdae27555853c2c57f7aa91179bc39407dc77bc.tar.gz
chromium_src-cfdae27555853c2c57f7aa91179bc39407dc77bc.tar.bz2
Linux: For mouse button clicks, only send buttons 1, 2, 3 to the renderer.
BUG=16236 TEST=no more sad tab on clicking mouse back button Review URL: http://codereview.chromium.org/155250 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20217 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 0a16e49..590d328 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -220,6 +220,9 @@ class RenderWidgetHostViewGtkWidget {
static gboolean ButtonPressReleaseEvent(
GtkWidget* widget, GdkEventButton* event,
RenderWidgetHostViewGtk* host_view) {
+ if (!(event->button == 1 || event->button == 2 || event->button == 3))
+ return FALSE; // We do not forward any other buttons to the renderer.
+
// We want to translate the coordinates of events that do not originate
// from this widget to be relative to the top left of the widget.
GtkWidget* event_widget = gtk_get_event_widget(
@@ -253,7 +256,7 @@ class RenderWidgetHostViewGtkWidget {
if (event->type == GDK_BUTTON_PRESS && !GTK_WIDGET_HAS_FOCUS(widget))
gtk_widget_grab_focus(widget);
- return FALSE;
+ return TRUE; // We did handle the mouse event.
}
static gboolean MouseMoveEvent(GtkWidget* widget, GdkEventMotion* event,