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

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

Issue 149729: Add some missing hotkeys.... (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 | « chrome/browser/gtk/browser_window_gtk.cc ('k') | 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 20762)
+++ chrome/browser/renderer_host/render_widget_host_view_gtk.cc (working copy)
@@ -72,8 +72,10 @@
G_CALLBACK(ButtonPressReleaseEvent), host_view);
g_signal_connect(widget, "motion-notify-event",
G_CALLBACK(MouseMoveEvent), host_view);
- g_signal_connect(widget, "scroll-event",
- G_CALLBACK(MouseScrollEvent), 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",
+ G_CALLBACK(MouseScrollEvent), host_view);
// Create a GtkIMContext instance and attach its signal handlers.
host_view->im_context_ = gtk_im_multicontext_new();
@@ -291,6 +293,16 @@
static gboolean MouseScrollEvent(GtkWidget* widget, GdkEventScroll* event,
RenderWidgetHostViewGtk* host_view) {
+ // If the user is holding shift, translate it into a horizontal scroll. We
+ // don't care what other modifiers the user may be holding (zooming is
+ // handled at the TabContentsView level).
+ if (event->state & GDK_SHIFT_MASK) {
+ if (event->direction == GDK_SCROLL_UP)
+ event->direction = GDK_SCROLL_LEFT;
+ else if (event->direction == GDK_SCROLL_DOWN)
+ event->direction = GDK_SCROLL_RIGHT;
+ }
+
host_view->GetRenderWidgetHost()->ForwardWheelEvent(
WebInputEventFactory::mouseWheelEvent(event));
return FALSE;
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698