diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2013-02-14 17:11:28 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2013-02-14 17:19:53 -0500 |
commit | ce835dee743477b0afeb2d8ea77172af63c1ac43 (patch) | |
tree | 375b6347db58e1fe04e8f8607f7bfe59d24cae8d /gtk/gtkcontainer.c | |
parent | 7bb07317f303d204305f6fdac72020dd257025e6 (diff) | |
download | gtk+-ce835dee743477b0afeb2d8ea77172af63c1ac43.tar.gz |
GtkContainer: fix disconnection from frame clock
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.c | 23 |
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) { |