From 28f328e09c6227ab6248c91ae0690a02d9d23300 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 14 Nov 2011 14:42:29 +0000 Subject: [PATCH] Fix placeholder creation when dragging from one DnDVBox to another (should fix #4421). git-svn-id: svn://localhost/ardour2/branches/3.0@10584 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index cd7bf01a79..a5b85234c4 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -416,13 +416,19 @@ private: /* whether we're in the top or bottom half of the child that we're over */ bool top_half = (c - int (c)) < 0.5; - if (top_half && (before == _drag_child || at == _drag_child)) { + /* Note that when checking on whether to remove a placeholder, we never do + so if _drag_child is 0 as this means that the child being dragged is + coming from a different DnDVBox, so it will never be the same as any + of our children. + */ + + if (top_half && _drag_child && (before == _drag_child || at == _drag_child)) { /* dropping here would have no effect, so remove the visual cue */ remove_placeholder (); return false; } - if (!top_half && (at == _drag_child || after == _drag_child)) { + if (!top_half && _drag_child && (at == _drag_child || after == _drag_child)) { /* dropping here would have no effect, so remove the visual cue */ remove_placeholder (); return false;