Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
 **/
gdouble
_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);**
  else
    **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;
}
share|improve this question

closed as too localized by nitstorm, 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. –  nitstorm Feb 28 '12 at 16:25