I needed to change the mouse wheel scroll rate in GTK applications. I downloaded and modified GTK3 source code. I recompiled it. It did the trick for gedit and nautilus. But did not do it for gnome-terminal even though it is a GTK3 application.

I changed the lines starting with delta= in the if-else clause. Just changed the numbers to weird ones so that I can see the change if there is any.

Here are the change I made to gtk/gtkrange.c:

 * _gtk_range_get_wheel_delta:
 * @range: a #GtkRange
 * @direction: A #GdkScrollDirection
 * Returns a good step value for the mouse wheel.
 * Return value: A good step value for the mouse wheel. 
 * Since: 2.4
_gtk_range_get_wheel_delta (GtkRange           *range,
                GdkScrollDirection  direction)
  GtkRangePrivate *priv = range->priv;
  GtkAdjustment *adjustment = priv->adjustment;
  gdouble delta;

  if (GTK_IS_SCROLLBAR (range))
    **delta = pow (gtk_adjustment_get_page_size (adjustment), 1.0 / 94.0);**
    **delta = gtk_adjustment_get_step_increment (adjustment) * 400;**

  if (direction == GDK_SCROLL_UP ||
      direction == GDK_SCROLL_LEFT)
    delta = - delta;

  if (priv->inverted)
    delta = - delta;

  return delta;

closed as too localized by Nitin Venkatesh, jrg Mar 2 '12 at 19:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Since your changes and compilation obviously worked, the only remaining question seems to be whether gnome-terminal actually uses this part of the code. Have you found the code where this happens? – xubuntix Nov 8 '11 at 21:31
  • Hello, this question has no information and activity for a very long time. I am voting to close it for now. If by any reason you think this question is still viable or useful in anyways or that there is still a good chance it will be answered please flag it to a moderator or add a comment with the reasons why you want it open. Regards. – Nitin Venkatesh Feb 28 '12 at 16:25