+ /* Originally this was:
+ *
+ * gtk_tree_view_set_reorderable(GTK_TREE_VIEW(ql->view), TRUE);
+ *
+ * However this has a two deficiencies:
+ *
+ * 1) Only one row can be dragged at once. It would be nice
+ * to be able to do bulk rearrangements since the server
+ * can cope with that well.
+ * 2) Dragging between windows is not possible. When playlist
+ * support appears, it should be possible to drag tracks
+ * from the choose tag into the playlist.
+ *
+ * At the time of writing neither of these problems are fully solved, the
+ * code as it stands is just a stepping stone in that direction.
+ */
+
+ /* This view will act as a drag source */
+ gtk_drag_source_set(ql->view,
+ GDK_BUTTON1_MASK,
+ queuelike_targets,
+ sizeof queuelike_targets / sizeof *queuelike_targets,
+ GDK_ACTION_MOVE);
+ /* This view will act as a drag destination */
+ gtk_drag_dest_set(ql->view,
+ GTK_DEST_DEFAULT_HIGHLIGHT|GTK_DEST_DEFAULT_DROP,
+ queuelike_targets,
+ sizeof queuelike_targets / sizeof *queuelike_targets,
+ GDK_ACTION_MOVE|GDK_ACTION_COPY);
+ g_signal_connect(ql->view, "drag-motion",
+ G_CALLBACK(ql_drag_motion), ql);
+ g_signal_connect(ql->view, "drag-leave",
+ G_CALLBACK(ql_drag_leave), ql);
+ g_signal_connect(ql->view, "drag-data-get",
+ G_CALLBACK(ql_drag_data_get), ql);
+ g_signal_connect(ql->view, "drag-data-received",
+ G_CALLBACK(ql_drag_data_received), ql);
+ make_treeview_multidrag(ql->view, NULL);
+ // TODO playing track should be refused by predicate arg
+ } else {
+ /* For queues that cannot accept a drop we still accept a copy out */
+ gtk_drag_source_set(ql->view,
+ GDK_BUTTON1_MASK,
+ queuelike_targets,
+ sizeof queuelike_targets / sizeof *queuelike_targets,
+ GDK_ACTION_COPY);
+ g_signal_connect(ql->view, "drag-data-get",
+ G_CALLBACK(ql_drag_data_get), ql);
+ make_treeview_multidrag(ql->view, NULL);