- /* commenting out the next, fixes NB#62963 */
-#if 0
- /* Set focus on next header */
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW (widget));
- gtk_tree_path_next (source_row);
- gtk_tree_selection_select_path (sel, source_row);
+ /* Set the data. Do not use the current selection because it
+ could be different than the selection at the beginning of
+ the d&d */
+ modest_dnd_selection_data_set_paths (selection_data,
+ priv->drag_begin_cached_selected_rows);
+}
+
+/**
+ * We're caching the selected rows at the beginning because the
+ * selection could change between drag-begin and drag-data-get, for
+ * example if we have a set of rows already selected, and then we
+ * click in one of them (without SHIFT key pressed) and begin a drag,
+ * the selection at that moment contains all the selected lines, but
+ * after dropping the selection, the release event provokes that only
+ * the row used to begin the drag is selected, so at the end the
+ * drag&drop affects only one rows instead of all the selected ones.
+ *
+ */
+static void
+drag_begin_cb (GtkWidget *widget,
+ GdkDragContext *context,
+ gpointer data)
+{
+ ModestHeaderView *self = NULL;
+ ModestHeaderViewPrivate *priv = NULL;
+ GtkTreeSelection *selection;