From f8e73c529361bb8fbf0423c2cd8c99b5dffb8283 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 2 Sep 2010 01:49:38 +0200 Subject: [PATCH] PianoView: send NoteOff MIDI events for all keys on focus out Commit 491910357b54a5d17e74c70ae3bb73cd780b254f was a first try to fix bug #3052228 but it broke InstrumentPlayHandle-driven instruments. When losing focus now simply send NoteOff MIDI events for all keys regardless of the state indicated by Piano::m_pressedKeys. Closes #3052228. --- src/gui/PianoView.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 343f1a4d1..a0c5dea9e 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -715,13 +715,10 @@ void PianoView::focusOutEvent( QFocusEvent * ) // hang otherwise for( int i = 0; i < NumKeys; ++i ) { - if( m_piano->m_pressedKeys[i] == true ) - { - m_piano->m_midiEvProc->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, i, 0 ), midiTime() ); - m_piano->m_pressedKeys[i] = false; - } + m_piano->m_pressedKeys[i] = false; } update(); }