diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 21:53:06 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 21:53:06 +0000 |
commit | 95a46221f3add0338d0f5c53b92ef4e94b5e30e0 (patch) | |
tree | a29a1df5f7a73bfe263a90a46dd27f8d7151ec34 /chrome/browser | |
parent | db30527a4f5017945dca3db5cf6cb5e1d589387e (diff) | |
download | chromium_src-95a46221f3add0338d0f5c53b92ef4e94b5e30e0.zip chromium_src-95a46221f3add0338d0f5c53b92ef4e94b5e30e0.tar.gz chromium_src-95a46221f3add0338d0f5c53b92ef4e94b5e30e0.tar.bz2 |
Fix bug where crossing events (mouse enter, mouse leave) were being sent
when the mouse button is down, causing duplicate events that caused serious
problems with drag and drop of selections in gmail, plus other problems.
The crossing events should still be sent when the mouse button is not down.
BUG=27264
TEST=confirmed that gmail bug is no longer reproducible; trybot succeeded
patch by Dominic Mazzoni <dmazzoni at goog>
original review: http://codereview.chromium.org/387038
Review URL: http://codereview.chromium.org/389024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_gtk.cc | 18 |
1 files changed, 16 insertions, 2 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 e5fe05e..f91a18c 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -257,8 +257,22 @@ class RenderWidgetHostViewGtkWidget { static gboolean CrossingEvent(GtkWidget* widget, GdkEventCrossing* event, RenderWidgetHostViewGtk* host_view) { - host_view->GetRenderWidgetHost()->ForwardMouseEvent( - WebInputEventFactory::mouseEvent(event)); + const int any_button_mask = + GDK_BUTTON1_MASK | + GDK_BUTTON2_MASK | + GDK_BUTTON3_MASK | + GDK_BUTTON4_MASK | + GDK_BUTTON5_MASK; + + // Only forward crossing events if the mouse button is not down. + // (When the mouse button is down, the proper events are already being + // sent by ButtonPressReleaseEvent and MouseMoveEvent, above, and if we + // additionally send this crossing event with the state indicating the + // button is down, it causes problems with drag and drop in WebKit.) + if (!(event->state & any_button_mask)) { + host_view->GetRenderWidgetHost()->ForwardMouseEvent( + WebInputEventFactory::mouseEvent(event)); + } return FALSE; } |