From dcb732f07cadd280bc3e16c4a2942e6bd7259f74 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 27 Apr 2024 00:03:46 +0200 Subject: [PATCH] Only allow editing top-most MIDI region in layered view NoteDrag (change pitch) only works correctly for the topmost region when using Stacked LayerDisplay. Note-grid is also only displayed for the top layer. --- gtk2_ardour/note_base.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index 40bdbbf93f..a6ad6e6bc9 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -293,6 +293,14 @@ NoteBase::event_handler (GdkEvent* ev) return false; } + if (_region.get_time_axis_view ().layer_display () == Stacked) { + /* only allow edting notes in the topmost layer */ + if (_region.region()->layer() != _region.region()->playlist()->top_layer ()) { + /* this stll allows the draw tool to work, and edit cursor is updated */ + return false; + } + } + switch (ev->type) { case GDK_ENTER_NOTIFY: _region.note_entered (this);