diff options
author | Benjamin Otte <otte@redhat.com> | 2012-04-05 15:48:51 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2012-04-05 15:48:51 +0200 |
commit | 917ca6a802af574232f413fdf904e1633d706b52 (patch) | |
tree | f4b5a54edd4beeba37126b870f2addbfd8f33d86 /gtk/gtkrange.c | |
parent | d55961adf9a40522893da93e1ca857689f1e67a8 (diff) | |
download | gtk+-917ca6a802af574232f413fdf904e1633d706b52.tar.gz |
gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r-- | gtk/gtkrange.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index c7a2b52665..c35b48e239 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -116,8 +116,6 @@ struct _GtkRangePrivate gint slider_start; /* Slider range along the long dimension, in widget->window coords */ gint slider_end; - guint repaint_id; - /* Steppers are: < > ---- < > * a b c d */ @@ -1499,10 +1497,6 @@ gtk_range_destroy (GtkWidget *widget) gtk_range_remove_step_timer (range); - if (priv->repaint_id) - g_source_remove (priv->repaint_id); - priv->repaint_id = 0; - if (priv->adjustment) { g_signal_handlers_disconnect_by_func (priv->adjustment, @@ -2034,11 +2028,6 @@ gtk_range_draw (GtkWidget *widget, "focus-padding", &focus_padding, NULL); - /* we're now exposing, so there's no need to force early repaints */ - if (priv->repaint_id) - g_source_remove (priv->repaint_id); - priv->repaint_id = 0; - gtk_range_calc_marks (range); gtk_range_calc_layout (range, gtk_adjustment_get_value (priv->adjustment)); @@ -2984,20 +2973,6 @@ gtk_range_adjustment_changed (GtkAdjustment *adjustment, */ } -static gboolean -force_repaint (gpointer data) -{ - GtkRange *range = GTK_RANGE (data); - GtkRangePrivate *priv = range->priv; - GtkWidget *widget = GTK_WIDGET (range); - - priv->repaint_id = 0; - if (gtk_widget_is_drawable (widget)) - gdk_window_process_updates (gtk_widget_get_window (widget), FALSE); - - return FALSE; -} - static void gtk_range_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data) @@ -3014,11 +2989,6 @@ gtk_range_adjustment_value_changed (GtkAdjustment *adjustment, (GTK_IS_SCALE (range) && gtk_scale_get_draw_value (GTK_SCALE (range)))) { gtk_widget_queue_draw (GTK_WIDGET (range)); - /* setup a timer to ensure the range isn't lagging too much behind the scroll position */ - if (!priv->repaint_id) - priv->repaint_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS, - 181, force_repaint, - range, NULL); } /* Note that we don't round off to priv->round_digits here. |