diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 23:51:35 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 23:51:35 +0000 |
commit | 60507b1cedf0d19b1a5d9034abb2eb25a2432439 (patch) | |
tree | 582b93535b8622b49a98ad3cd9920277f8412c79 /chrome/browser/renderer_host | |
parent | 9f5e42c18b9d6f20338d90d6330111f2454bd986 (diff) | |
download | chromium_src-60507b1cedf0d19b1a5d9034abb2eb25a2432439.zip chromium_src-60507b1cedf0d19b1a5d9034abb2eb25a2432439.tar.gz chromium_src-60507b1cedf0d19b1a5d9034abb2eb25a2432439.tar.bz2 |
Re-landing of r30726, which was reverted as a possible cause of chromeos buildbot failures
Handle GTK enter and leave notification events and pass them to WebKit as
mouse move events. This prevents an HTML widget from staying in the mouseover
state when the cursor leaves the window. Add a new ui test that checks
the specific case that was broken by warping the mouse pointer inside and
outside the content area.
BUG=24660
TEST=ui_tests
patch by Dominic Mazzoni <dmazzoni [at] google>
original review: http://codereview.chromium.org/274010/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30771 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_gtk.cc | 18 |
1 files changed, 17 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 250e0ab..e89aef2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -60,7 +60,10 @@ class RenderWidgetHostViewGtkWidget { GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK); + GDK_KEY_RELEASE_MASK | + GDK_FOCUS_CHANGE_MASK | + GDK_ENTER_NOTIFY_MASK | + GDK_LEAVE_NOTIFY_MASK); GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); g_signal_connect(widget, "size-allocate", @@ -83,6 +86,11 @@ class RenderWidgetHostViewGtkWidget { G_CALLBACK(ButtonPressReleaseEvent), host_view); g_signal_connect(widget, "motion-notify-event", G_CALLBACK(MouseMoveEvent), host_view); + g_signal_connect(widget, "enter-notify-event", + G_CALLBACK(CrossingEvent), host_view); + g_signal_connect(widget, "leave-notify-event", + G_CALLBACK(CrossingEvent), host_view); + // Connect after so that we are called after the handler installed by the // TabContentsView which handles zoom events. g_signal_connect_after(widget, "scroll-event", @@ -257,6 +265,14 @@ class RenderWidgetHostViewGtkWidget { return FALSE; } + static gboolean CrossingEvent(GtkWidget* widget, GdkEventCrossing* event, + RenderWidgetHostViewGtk* host_view) { + host_view->GetRenderWidgetHost()->ForwardMouseEvent( + WebInputEventFactory::mouseEvent(event)); + + return FALSE; + } + static gboolean MouseScrollEvent(GtkWidget* widget, GdkEventScroll* event, RenderWidgetHostViewGtk* host_view) { // If the user is holding shift, translate it into a horizontal scroll. We |