diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 07:49:42 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 07:49:42 +0000 |
commit | 459495233475fbef978d5e06bf80914c78f68109 (patch) | |
tree | 2ea914d6b35aa7402e3fd89b6b5b4c4086e92308 /webkit/tools/test_shell | |
parent | af9d8d32279a222e31e0e81ec9e6825764054787 (diff) | |
download | chromium_src-459495233475fbef978d5e06bf80914c78f68109.zip chromium_src-459495233475fbef978d5e06bf80914c78f68109.tar.gz chromium_src-459495233475fbef978d5e06bf80914c78f68109.tar.bz2 |
GTK test_shell: don't send some mouse events to renderer.
test_shell crashses if we double/triple click or press buttons whose id is greater than 3. After this change, we ignore such mouse events just like chromium.
Corresponding changes:
http://codereview.chromium.org/155250
http://codereview.chromium.org/431031
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/435041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 2dd37bd..0b1439b 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -230,6 +230,10 @@ class WebWidgetHostGtkWidget { static gboolean HandleButtonPress(GtkWidget* widget, GdkEventButton* event, WebWidgetHost* host) { + if (!(event->button == 1 || event->button == 2 || event->button == 3)) + return FALSE; // We do not forward any other buttons to the renderer. + if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS) + return FALSE; host->webwidget()->handleInputEvent( WebInputEventFactory::mouseEvent(event)); return FALSE; |