summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-05 15:16:55 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-05 15:16:55 -0400
commitad346dc638c1b87af571cb8a920c0d7151da5a94 (patch)
tree857775ba46bb24e6958a351f7007884eaab1afc3 /gtk2_ardour
parentef9bf58359e8331f9495242a7d4a02e785931a4a (diff)
reinstate a canvas group where we reparent regions while dragging, so that they are always on top.
I mistakenly removed this during the onecanvas changes.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.h5
-rw-r--r--gtk2_ardour/editor_canvas.cc6
-rw-r--r--gtk2_ardour/editor_drag.cc11
-rw-r--r--gtk2_ardour/time_axis_view_item.cc6
-rw-r--r--gtk2_ardour/time_axis_view_item.h1
5 files changed, 28 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index d486e5b9f0..0d640c1f9d 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -744,6 +744,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* The group containing all trackviews. */
ArdourCanvas::Group* _trackview_group;
+ /* The group holding things (mostly regions) while dragging so they
+ * are on top of everything else
+ */
+ ArdourCanvas::Group* _drag_motion_group;
+
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
* target area.
*/
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 6374481464..c1302aa785 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -118,6 +118,12 @@ Editor::initialize_canvas ()
_trackview_group = new ArdourCanvas::Group (hv_scroll_group);
CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
+ /* a group to hold stuff while it gets dragged around. Must be the
+ * uppermost (last) group with hv_scroll_group as a parent
+ */
+ _drag_motion_group = new ArdourCanvas::Group (hv_scroll_group);
+ CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
+
/* TIME BAR CANVAS */
_time_markers_group = new ArdourCanvas::Group (h_scroll_group);
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 7004f9b419..2cea513c1a 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -704,7 +704,16 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (first_move) {
rv->drag_start ();
rv->fake_set_opaque (true);
- rv->raise_to_top ();
+
+ /* reparent the regionview into a group above all
+ * others
+ */
+
+ ArdourCanvas::Group* rvg = rv->get_canvas_group();
+ Duple rv_canvas_offset = rvg->parent()->item_to_canvas (Duple (0,0));
+ Duple dmg_canvas_offset = _editor->_drag_motion_group->item_to_canvas (Duple (0,0));
+ rv->get_canvas_group()->reparent (_editor->_drag_motion_group);
+ rvg->move (rv_canvas_offset - dmg_canvas_offset);
}
/* If we have moved tracks, we'll fudge the layer delta so that the
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 0ae4ec72f2..81d944dcf9 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -1044,3 +1044,9 @@ TimeAxisViewItem::parameter_changed (string p)
set_frame_gradient ();
}
}
+
+void
+TimeAxisViewItem::visual_raise_to_top ()
+{
+ group->raise_to_top ();
+}
diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h
index faa6ba5d06..cd813e17c9 100644
--- a/gtk2_ardour/time_axis_view_item.h
+++ b/gtk2_ardour/time_axis_view_item.h
@@ -76,6 +76,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
void set_name_text_color ();
uint32_t get_fill_color () const;
+ void visual_raise_to_top ();
ArdourCanvas::Item* get_canvas_frame();
ArdourCanvas::Group* get_canvas_group();