Skip to content

Commit 8c3f5ec

Browse files
committed
Fix #18437
1 parent 5ab5e82 commit 8c3f5ec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/context/internal/globalcontext.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ void GlobalContext::doSetCurrentNotation(const INotationPtr& notation)
9595
return;
9696
}
9797

98+
// End note input on the outgoing notation to prevent stale InputState
99+
// that can cause corruption when notes are entered on the new notation
100+
// and propagated back via linked clones (see #18437)
101+
if (m_currentNotation) {
102+
auto noteInput = m_currentNotation->interaction()->noteInput();
103+
if (noteInput->isNoteInputMode()) {
104+
noteInput->endNoteInput(false);
105+
}
106+
}
107+
98108
m_currentNotation = notation;
99109

100110
if (m_currentNotation) {

0 commit comments

Comments
 (0)