fix management of undo/redo and _current_editing_context

We cannot switch on a leave event from a widget, because the undo/redo menu items must remain
labelled until we are actually in a new editing context. So switch when we switch tabs
or when we edit the (MIDI) cue editor
This commit is contained in:
Paul Davis 2024-06-30 14:20:53 -06:00
parent e591bc91f9
commit 8523598664
5 changed files with 12 additions and 29 deletions

View file

@ -305,14 +305,13 @@ MidiCueEditor::canvas_enter_leave (GdkEventCrossing* ev)
if (ev->detail != GDK_NOTIFY_INFERIOR) {
_canvas_viewport->canvas()->grab_focus ();
ActionManager::set_sensitive (_midi_actions, true);
EditingContext::push_editing_context (this);
EditingContext::switch_editing_context (this);
}
break;
case GDK_LEAVE_NOTIFY:
if (ev->detail != GDK_NOTIFY_INFERIOR) {
ActionManager::set_sensitive (_midi_actions, false);
ARDOUR_UI::instance()->reset_focus (_canvas_viewport);
EditingContext::pop_editing_context ();
}
default:
break;