From 911f94ecaa6de172dfdee80981f2686f2997dff6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 2 May 2024 20:24:58 -0600 Subject: [PATCH] TimeAxisView event handling calls into Editor track DnD code --- gtk2_ardour/time_axis_view.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 2d80131689..5808b6778c 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -438,7 +438,13 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event) _ebox_release_can_act = true; if (maybe_set_cursor (event->y) > 0) { + _resize_drag_start = event->y_root; + + } else { + if (event->button == 1) { + _editor.start_track_drag (*this, event->y, controls_ebox); + } } return true; @@ -453,6 +459,12 @@ TimeAxisView::idle_resize (int32_t h) bool TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) { + if (_editor.track_dragging()) { + _editor.mid_track_drag (ev, controls_ebox); + gdk_event_request_motions (ev); + return true; + } + if (_resize_drag_start >= 0) { /* (ab)use the DragManager to do autoscrolling - basically we @@ -468,13 +480,15 @@ TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) _editor.add_to_idle_resize (this, delta); _resize_drag_start = ev->y_root; _did_resize = true; + gdk_event_request_motions (ev); + return true; } else { /* not dragging but ... */ maybe_set_cursor (ev->y); } - gdk_event_request_motions(ev); - return true; + gdk_event_request_motions (ev); + return false; } bool