summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-04-16 12:16:45 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-04-16 17:48:12 -0600
commit65f7a6a9388d8462a08dd8da7a218baca099649f (patch)
treec532f3a8492dec66a9e27f423ded11982fdde16d /gtk2_ardour/editor_mouse.cc
parent921e3e75b5f03ff9d38e12c28167e377c1254926 (diff)
changes to deal with region/note selection when changing into/out of internal edit mode
Also, activate MIDI editing actions so that they are effective in internal edit mode
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 7d63c4925d..2437dc31b8 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -347,6 +347,38 @@ Editor::mouse_mode_toggled (MouseMode m)
update_time_selection_display ();
+ if (internal_editing()) {
+
+ /* reinstate any existing MIDI note (and by extension, MIDI
+ * region) selection for internal edit mode. This allows a user
+ * to enter/exit/enter this mode without losing a selection of
+ * notes.
+ */
+
+ catch_up_on_midi_selection ();
+
+ /* ensure that the track canvas has focus, so that key events
+ will get directed to the correct place.
+ */
+ _track_canvas->grab_focus ();
+
+ /* enable MIDI editing actions, which in turns enables their
+ bindings
+ */
+ ActionManager::set_sensitive (_midi_actions, true);
+
+ /* mark "magic widget focus" so that we handle key events
+ * correctly
+ */
+ Keyboard::magic_widget_grab_focus ();
+ } else {
+ /* undo some of the above actions, since we're not in internal
+ edit mode.
+ */
+ ActionManager::set_sensitive (_midi_actions, false);
+ Keyboard::magic_widget_drop_focus ();
+ }
+
update_all_enter_cursors ();
MouseModeChanged (); /* EMIT SIGNAL */
@@ -2627,6 +2659,9 @@ Editor::escape ()
if (_drags->active ()) {
_drags->abort ();
} else if (_session) {
+
+ midi_action (&MidiRegionView::clear_note_selection);
+
selection->clear ();
/* if session is playing a range, cancel that */