summaryrefslogtreecommitdiff
path: root/gtk/gtkcontainer.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:11:28 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:11:28 -0500
commit96829e4f4032a388e4f181763c1e2cc23b09aac3 (patch)
treeaa201afe64c60c9d522ef7b466cb49f5231e8a9f /gtk/gtkcontainer.c
parenteee365964abaa1534c22827e61fb29a6e9f7a6b8 (diff)
downloadgtk+-wip/frame-synchronization.tar.gz
GtkContainer: fix disconnection from frame clockwip/frame-synchronization
We need to disconnect the frame clock when we unrealize (at which point the old clock is still alive) not in destroy(). Since there is no common unrealize for containers, trigger this from GtkWidget.
Diffstat (limited to 'gtk/gtkcontainer.c')
-rw-r--r--gtk/gtkcontainer.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index e73ef2a700..ce16fe4df4 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1362,13 +1362,6 @@ gtk_container_destroy (GtkWidget *widget)
if (priv->restyle_pending)
priv->restyle_pending = FALSE;
- if (priv->resize_handler)
- {
- g_signal_handler_disconnect (priv->resize_clock, priv->resize_handler);
- priv->resize_handler = 0;
- priv->resize_clock = NULL;
- }
-
if (priv->focus_child)
{
g_object_unref (priv->focus_child);
@@ -1680,9 +1673,7 @@ gtk_container_idle_sizer (GdkFrameClock *clock,
if (!container->priv->restyle_pending && !container->priv->resize_pending)
{
- g_signal_handler_disconnect (clock, container->priv->resize_handler);
- container->priv->resize_handler = 0;
- container->priv->resize_clock = NULL;
+ _gtk_container_stop_idle_sizer (container);
}
else
{
@@ -1710,6 +1701,18 @@ gtk_container_start_idle_sizer (GtkContainer *container)
GDK_FRAME_CLOCK_PHASE_LAYOUT);
}
+void
+_gtk_container_stop_idle_sizer (GtkContainer *container)
+{
+ if (container->priv->resize_handler == 0)
+ return;
+
+ g_signal_handler_disconnect (container->priv->resize_clock,
+ container->priv->resize_handler);
+ container->priv->resize_handler = 0;
+ container->priv->resize_clock = NULL;
+}
+
static void
gtk_container_queue_resize_handler (GtkContainer *container)
{