diff options
author | Carl Hetherington <carl@carlh.net> | 2010-05-16 18:51:05 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-05-16 18:51:05 +0000 |
commit | 50615cd17c06a5f4c8a196182407ceee7d182635 (patch) | |
tree | 8555861b8894e2348da1e418b8d60bdc748428d2 /libs | |
parent | 20724294c281d63361d98c1ee255ef51f34a8557 (diff) |
Fix crash when dragging something from another task over the editor window.
git-svn-id: svn://localhost/ardour2/branches/3.0@7107 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/dndtreeview.cc | 1 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/dndtreeview.h | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/dndtreeview.cc b/libs/gtkmm2ext/dndtreeview.cc index 0695dd3281..179423f203 100644 --- a/libs/gtkmm2ext/dndtreeview.cc +++ b/libs/gtkmm2ext/dndtreeview.cc @@ -69,6 +69,7 @@ bool DnDTreeViewBase::on_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) { suggested_action = Gdk::DragAction (0); + drag_data.source = 0; return TreeView::on_drag_drop (context, x, y, time); } diff --git a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h index 6295377672..b5f18fa890 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h @@ -70,6 +70,8 @@ class DnDTreeViewBase : public Gtk::TreeView std::string object_type; struct DragData { + DragData () : source (0) {} + Gtk::TreeView* source; int data_column; std::string object_type; @@ -134,11 +136,16 @@ class DnDTreeView : public DnDTreeViewBase } /** - * this can be called by the Treeview itself or by some other + * This can be called by the Treeview itself or by some other * object that wants to get the list of dragged items. */ void get_object_drag_data (std::list<DataType>& l, Gtk::TreeView** source) { + + if (drag_data.source == 0) { + return; + } + Glib::RefPtr<Gtk::TreeModel> model = drag_data.source->get_model(); DataType v; Gtk::TreeSelection::ListHandle_Path selection = drag_data.source->get_selection()->get_selected_rows (); |