aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-canvas.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-canvas.c')
-rw-r--r--e-util/e-canvas.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/e-util/e-canvas.c b/e-util/e-canvas.c
index 0da4dade28..4cb912283e 100644
--- a/e-util/e-canvas.c
+++ b/e-util/e-canvas.c
@@ -583,6 +583,7 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
ECanvas *canvas;
ECanvasSelectionInfo *info;
ECanvasItemSelectionFunc func;
+ GList *list;
g_return_if_fail(item != NULL);
g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
@@ -602,6 +603,24 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR;
+ for (list = canvas->selection; list; list = g_list_next(list)) {
+ ECanvasSelectionInfo *search;
+ search = list->data;
+
+ if (search->item == item) {
+ ECanvasItemSelectionCompareFunc compare_func;
+ compare_func = gtk_object_get_data(GTK_OBJECT(search->item), "ECanvasItem::selection_compare_callback");
+
+ if (compare_func(search->item, search->id, id, 0) == 0) {
+ canvas->cursor = search;
+ func = gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::selection_callback");
+ if (func)
+ func(item, flags, search->id);
+ return;
+ }
+ }
+ }
+
info = g_new(ECanvasSelectionInfo, 1);
info->item = item;
info->id = id;