From 2cb76e082071668102259a45dffedc3a811bdcf9 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 16 Mar 2018 20:14:33 +0000 Subject: [PATCH] Bug 1852 - Ctrl+M does not open label for editing - Now when recording, the recording track has a number >=0 and so the modified test will set the cursor for editing the label. - Bug 305 is still fixed, because Nyquist will pass -2 for the restore track. --- src/LabelTrack.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LabelTrack.cpp b/src/LabelTrack.cpp index 2357a7dff..2f9205b42 100644 --- a/src/LabelTrack.cpp +++ b/src/LabelTrack.cpp @@ -2725,7 +2725,11 @@ int LabelTrack::AddLabel(const SelectedRegion &selectedRegion, mLabels.insert(mLabels.begin() + pos, l); - if( restoreFocus == -1 ) + // restoreFocus is -2 e.g. from Nyquist label creation, when we should not + // even lose the focus and open the label to edit in the first place. + // -1 means we don't need to restore it to anywhere. + // 0 or above is the track to restore to afetr editing the label is complete. + if( restoreFocus >= -1 ) mSelIndex = pos; // Make sure the caret is visible