From 73fe6fb330ac9fab009d2bcb5766a2b908a201c7 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 10 Jan 2012 19:30:23 +0100 Subject: Bug #667398 - Automatic mark-as-seen too aggressive --- widgets/table/e-tree.c | 23 +++++++++++++++++++++++ widgets/table/e-tree.h | 2 ++ 2 files changed, 25 insertions(+) (limited to 'widgets') diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index e24ce6a6e0..ffcca22457 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -200,6 +200,8 @@ struct _ETreePrivate { gboolean state_changed; guint state_change_freeze; + + gboolean is_dragging; }; static guint et_signals[LAST_SIGNAL] = { 0, }; @@ -638,6 +640,8 @@ e_tree_init (ETree *e_tree) e_tree->priv->state_changed = FALSE; e_tree->priv->state_change_freeze = 0; + + e_tree->priv->is_dragging = FALSE; } /* Grab_focus handler for the ETree */ @@ -2826,6 +2830,21 @@ e_tree_drag_begin (ETree *tree, event); } +/** + * e_tree_is_dragging: + * @tree: An #ETree widget + * + * Returns whether is @tree in a drag&drop operation. + **/ +gboolean +e_tree_is_dragging (ETree *tree) +{ + g_return_val_if_fail (tree != NULL, FALSE); + g_return_val_if_fail (tree->priv != NULL, FALSE); + + return tree->priv->is_dragging; +} + /** * e_tree_get_cell_at: * @tree: An ETree widget @@ -2928,6 +2947,8 @@ et_drag_begin (GtkWidget *widget, GdkDragContext *context, ETree *et) { + et->priv->is_dragging = TRUE; + g_signal_emit (et, et_signals[TREE_DRAG_BEGIN], 0, et->priv->drag_row, @@ -2941,6 +2962,8 @@ et_drag_end (GtkWidget *widget, GdkDragContext *context, ETree *et) { + et->priv->is_dragging = FALSE; + g_signal_emit (et, et_signals[TREE_DRAG_END], 0, et->priv->drag_row, diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 08e56039b3..ae5639999c 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -307,6 +307,8 @@ GdkDragContext *e_tree_drag_begin (ETree *tree, gint button, GdkEvent *event); +gboolean e_tree_is_dragging (ETree *tree); + /* Adapter functions */ gboolean e_tree_node_is_expanded (ETree *et, ETreePath path); -- cgit