diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-10-06 23:47:29 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-10-06 23:47:29 +0800 |
commit | c259b85c5d13726ca1c0e204e751e310943d2048 (patch) | |
tree | 070ca3d6213cfd25167f607293cf87acac7534be | |
parent | bed3e436a85520544851f337a71177783e7e401c (diff) | |
download | gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar.gz gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar.bz2 gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar.lz gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar.xz gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.tar.zst gsoc2013-evolution-c259b85c5d13726ca1c0e204e751e310943d2048.zip |
Use g_dataset_set_data_full to find out when the context is destroyed.
2001-10-06 Christopher James Lahey <clahey@ximian.com>
* e-tree.c (context_destroyed), e-table.c (context_destroyed): Use
g_dataset_set_data_full to find out when the context is destroyed.
Fixes Ximian bug #8502 and Ximian bug #11691.
svn path=/trunk/; revision=13482
-rw-r--r-- | widgets/table/e-table.c | 22 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 23 |
2 files changed, 45 insertions, 0 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 9f250da2c2..0d148459b7 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -2079,6 +2079,27 @@ scroll_off (ETable *et) } static void +context_destroyed (gpointer data) +{ + ETable *et = data; + et->last_drop_x = 0; + et->last_drop_y = 0; + et->last_drop_time = 0; + et->last_drop_context = NULL; + scroll_off (et); + gtk_object_unref (GTK_OBJECT (et)); +} + +static void +context_connect (ETable *et, GdkDragContext *context) +{ + if (g_dataset_get_data (context, "e-table") == NULL) { + gtk_object_ref (GTK_OBJECT (et)); + g_dataset_set_data_full (context, "e-table", et, context_destroyed); + } +} + +static void et_drag_leave(GtkWidget *widget, GdkDragContext *context, guint time, @@ -2110,6 +2131,7 @@ et_drag_motion(GtkWidget *widget, et->last_drop_y = y; et->last_drop_time = time; et->last_drop_context = context; + context_connect (et, context); ret_val = do_drag_motion (et, context, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index acd841d085..9bb71f6c92 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -2211,6 +2211,28 @@ hover_off (ETree *et) } static void +context_destroyed (gpointer data) +{ + ETree *et = data; + et->priv->last_drop_x = 0; + et->priv->last_drop_y = 0; + et->priv->last_drop_time = 0; + et->priv->last_drop_context = NULL; + scroll_off (et); + hover_off (et); + gtk_object_unref (GTK_OBJECT (et)); +} + +static void +context_connect (ETree *et, GdkDragContext *context) +{ + if (g_dataset_get_data (context, "e-tree") == NULL) { + gtk_object_ref (GTK_OBJECT (et)); + g_dataset_set_data_full (context, "e-tree", et, context_destroyed); + } +} + +static void et_drag_leave(GtkWidget *widget, GdkDragContext *context, guint time, @@ -2244,6 +2266,7 @@ et_drag_motion(GtkWidget *widget, et->priv->last_drop_y = y; et->priv->last_drop_time = time; et->priv->last_drop_context = context; + context_connect (et, context); if (et->priv->hover_idle_id != 0) { if (abs (et->priv->hover_x - x) > 3 || |