From c8b2c0c543385f541e557d9dfc01dcc43f9fc680 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 8 Nov 2024 19:10:13 +0100 Subject: [PATCH] Fix crash looking up smart-mode we need to call get_toggle_action (char const*, char const, bool d = false) and not get_toggle_action (const string& name, bool) For whatever reason `(string, char*)` matches the latter function's signature. --- gtk2_ardour/editor_sections.cc | 4 ++-- gtk2_ardour/time_info_box.cc | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/editor_sections.cc b/gtk2_ardour/editor_sections.cc index aa986b6308..5fe41c0338 100644 --- a/gtk2_ardour/editor_sections.cc +++ b/gtk2_ardour/editor_sections.cc @@ -284,13 +284,13 @@ EditorSections::selection_changed () /* OK */ break; case Editing::MouseObject: - if (ActionManager::get_toggle_action ("MouseMode", "set-mouse-mode-object-range")->get_active ()) { + if (ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range")->get_active ()) { /* smart mode; OK */ break; } /*fallthrough*/ default: - Glib::RefPtr ract = ActionManager::get_radio_action (X_("MouseMode"), X_("set-mouse-mode-range")); + Glib::RefPtr ract = ActionManager::get_radio_action (PublicEditor::instance().editor_name().c_str(), X_("set-mouse-mode-range")); ract->set_active (true); break; } diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc index beba8bf9bd..694b19a5c4 100644 --- a/gtk2_ardour/time_info_box.cc +++ b/gtk2_ardour/time_info_box.cc @@ -313,11 +313,7 @@ TimeInfoBox::selection_changed () case Editing::MouseRange: if (selection.time.empty()) { - /* XXX we really ought to be calling - ::get_mouse_mode_action() here but there is no actual - mouse emode enum for smart mode (object-range). - */ - Glib::RefPtr tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name(), "set-mouse-mode-object-range"); + Glib::RefPtr tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range"); if (tact->get_active() && !selection.regions.empty()) { /* show selected regions */