From 192c7a2f9ad1992b68e6bbec0a18ef028d9214d3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 14 Aug 2025 18:48:04 -0600 Subject: [PATCH] fix for a subtle bug that led to track headers not expanding as intended now that we use action-as-state, there was no way to look up the old mouse mode when changing into or out of internal editing. this prevented us from queuing the redisplay of trackviews that allows the track headers to expand when appropriate. --- gtk2_ardour/cue_editor.cc | 1 + gtk2_ardour/editing_context.cc | 1 + gtk2_ardour/editing_context.h | 1 + gtk2_ardour/editor_mouse.cc | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/cue_editor.cc b/gtk2_ardour/cue_editor.cc index d41b568c65..17bedca994 100644 --- a/gtk2_ardour/cue_editor.cc +++ b/gtk2_ardour/cue_editor.cc @@ -1082,6 +1082,7 @@ CueEditor::mouse_mode_chosen (Editing::MouseMode m) * left. we'll get called again with the new mode active in a * jiffy. */ + old_mouse_mode = m; return; } diff --git a/gtk2_ardour/editing_context.cc b/gtk2_ardour/editing_context.cc index 2907e11537..e7f1f42d29 100644 --- a/gtk2_ardour/editing_context.cc +++ b/gtk2_ardour/editing_context.cc @@ -111,6 +111,7 @@ static const gchar *_zoom_focus_strings[] = { EditingContext::EditingContext (std::string const & name) : rubberband_rect (0) + , old_mouse_mode (Editing::MouseObject) , _name (name) , within_track_canvas (false) , pre_internal_grid_type (GridTypeBeat) diff --git a/gtk2_ardour/editing_context.h b/gtk2_ardour/editing_context.h index fc64ed2813..efe330ecf9 100644 --- a/gtk2_ardour/editing_context.h +++ b/gtk2_ardour/editing_context.h @@ -432,6 +432,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider, virtual ArdourCanvas::GtkCanvas* get_canvas() const = 0; virtual void mouse_mode_chosen (Editing::MouseMode) = 0; + Editing::MouseMode old_mouse_mode; bool on_velocity_scroll_event (GdkEventScroll*); void pre_render (); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 7c2304a4f1..20f18edf99 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -132,10 +132,11 @@ Editor::mouse_mode_chosen (MouseMode m) * left. we'll get called again with the new mode active in a * jiffy. */ + old_mouse_mode = m; return; } - const bool was_internal = internal_editing(); + const bool was_internal = (old_mouse_mode == Editing::MouseDraw || old_mouse_mode == Editing::MouseContent); /* Ben ToDo: once we have a dedicated 'region edit panel', we can store * one snap mode in the editor canvas and another one in the editor,