summaryrefslogtreecommitdiff
path: root/gtk/gtkwidget.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/gtkwidget.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/gtkwidget.c')
-rw-r--r--gtk/gtkwidget.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 79cf9e2ea1..48f996063e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4694,6 +4694,9 @@ gtk_widget_connect_frame_clock (GtkWidget *widget,
{
GtkWidgetPrivate *priv = widget->priv;
+ if (GTK_IS_CONTAINER (widget))
+ _gtk_container_maybe_start_idle_sizer (GTK_CONTAINER (widget));
+
if (priv->tick_callbacks != NULL)
{
g_signal_connect (frame_clock, "update",
@@ -4713,6 +4716,9 @@ gtk_widget_disconnect_frame_clock (GtkWidget *widget,
{
GtkWidgetPrivate *priv = widget->priv;
+ if (GTK_IS_CONTAINER (widget))
+ _gtk_container_stop_idle_sizer (GTK_CONTAINER (widget));
+
if (priv->tick_callbacks)
g_signal_handlers_disconnect_by_func (frame_clock,
(gpointer) gtk_widget_on_frame_clock_update,
@@ -4802,9 +4808,6 @@ gtk_widget_realize (GtkWidget *widget)
_gtk_widget_enable_device_events (widget);
gtk_widget_update_devices_mask (widget, TRUE);
- if (GTK_IS_CONTAINER (widget))
- _gtk_container_maybe_start_idle_sizer (GTK_CONTAINER (widget));
-
gtk_widget_connect_frame_clock (widget,
gtk_widget_get_frame_clock (widget));