From f78d82a192ec30132643d9a7397df4dc9467caf8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 7 Oct 2023 18:17:36 +0200 Subject: [PATCH] Allow single click to create Region-Gain points (again) regression was introduced in 18819a48a9 --- gtk2_ardour/editor_mouse.cc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index b674a0c966..505225fa3e 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1881,23 +1881,18 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT switch (item_type) { case RegionItem: { - /* check that we didn't drag before releasing, since - its really annoying to create new control - points when doing this. - */ - AudioRegionView* arv = dynamic_cast (clicked_regionview); + printf ("RegionItem\n"); + /* since we have FreehandLineDrag we can only get here after a drag, when no movement has happend */ + assert (were_dragging); - if (!were_dragging) { - if (arv) { - bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); - arv->add_gain_point_event (item, event, with_guard_points); - } - } else { - AutomationRegionView* atv = dynamic_cast (clicked_regionview); + AudioRegionView* arv = dynamic_cast (clicked_regionview); + AutomationRegionView* atv = dynamic_cast (clicked_regionview); - if (atv) { - atv->add_automation_event (event); - } + if (arv) { + bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); + arv->add_gain_point_event (item, event, with_guard_points); + } else if (atv) { + atv->add_automation_event (event); } return true;