[gtk+/wip/animated-scrolling] Fix unmap-during-animation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/animated-scrolling] Fix unmap-during-animation
- Date: Mon, 30 Jun 2014 15:02:55 +0000 (UTC)
commit 0ab99316291e217f6e1f8915899476c7536eefa7
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 30 11:01:54 2014 -0400
Fix unmap-during-animation
When disabling animation on unmap, we need to complete a running
animation and properly unregister from the clock.
gtk/gtkadjustment.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c
index 5171417..a124bac 100644
--- a/gtk/gtkadjustment.c
+++ b/gtk/gtkadjustment.c
@@ -962,13 +962,25 @@ gtk_adjustment_enable_animation (GtkAdjustment *adjustment,
{
GtkAdjustmentPrivate *priv = adjustment->priv;
- if (priv->clock)
- g_object_unref (priv->clock);
+ if (priv->clock != clock)
+ {
+ if (priv->tick_id)
+ {
+ adjustment_set_value (adjustment, priv->target);
- priv->clock = clock;
+ g_signal_handler_disconnect (priv->clock, priv->tick_id);
+ priv->tick_id = 0;
+ gdk_frame_clock_end_updating (priv->clock);
+ }
- if (priv->clock)
- g_object_ref (priv->clock);
+ if (priv->clock)
+ g_object_unref (priv->clock);
+
+ priv->clock = clock;
+
+ if (priv->clock)
+ g_object_ref (priv->clock);
+ }
priv->duration = duration;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]