scrolledwindow: Avoid too frequent redraws of scrollbars

When overshooting through touchpad kinetic scrolling, the scrollbar remains
mostly static as it already hit a boundary. However, the fade in/out checks
are constantly run during scroll events, causing needless redraws in this
specific case.
This commit is contained in:
Carlos Garnacho 2014-11-17 16:55:08 +01:00
parent 6d5f2ff87e
commit 7651061920

View File

@ -3387,7 +3387,9 @@ static void
indicator_set_fade (Indicator *indicator,
gdouble pos)
{
gboolean visible;
gboolean visible, changed;
changed = indicator->current_pos != pos;
indicator->current_pos = pos;
visible = indicator->current_pos != 0.0 || indicator->target_pos != 0.0;
@ -3404,9 +3406,12 @@ indicator_set_fade (Indicator *indicator,
indicator->conceil_timer = 0;
}
if (changed)
{
gtk_widget_set_opacity (indicator->scrollbar, indicator->current_pos);
gtk_widget_queue_draw (indicator->scrollbar);
}
}
static double
ease_out_cubic (double t)