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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 155250: Linux: For mouse button clicks, only send buttons 1, 2, 3 to the renderer.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_gtk.cc (revision 20205)
+++ chrome/browser/renderer_host/render_widget_host_view_gtk.cc (working copy)
@@ -220,6 +220,9 @@
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 @@
if (event->type == GDK_BUTTON_PRESS && !GTK_WIDGET_HAS_FOCUS(widget))
gtk_widget_grab_focus(widget);
Evan Martin 2009/07/09 00:01:08 I wonder if this bit of code is related to the mys
Evan Stade 2009/07/09 00:11:08 I wouldn't be too surprised, it's worth messing ar
- return FALSE;
+ return TRUE; // We did handle the mouse event.
}
static gboolean MouseMoveEvent(GtkWidget* widget, GdkEventMotion* event,
« 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