From 0610429ea39336f513e204092800c41463066e45 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 16 Oct 2008 20:44:35 +0000 Subject: [PATCH] reclaim keyboard focus if the current focus-widget lives in the same instrument-track-window as the previously active test piano - this way running notes are not stopped when modifying a control in the same instrument-track-window (closes #2139806) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1760 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ src/core/piano.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 769ebf5b2..16c7cba43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-10-16 Tobias Doerffel + * src/core/piano.cpp: + reclaim keyboard focus if the current focus-widget lives in the same + instrument-track-window as the previously active test piano - this way + running notes are not stopped when modifying a control in the same + instrument-track-window (closes #2139806) + * include/file_browser.h: * src/gui/file_browser.cpp: heavily improved performance when adding items to file browser diff --git a/src/core/piano.cpp b/src/core/piano.cpp index af2c91356..a9cff9a19 100644 --- a/src/core/piano.cpp +++ b/src/core/piano.cpp @@ -715,6 +715,16 @@ void pianoView::focusOutEvent( QFocusEvent * ) { return; } + + // focus just switched to another control inside the instrument track + // window we live in? + if( parentWidget()->parentWidget()->focusWidget() != this ) + { + // then reclaim keyboard focus! + setFocus(); + return; + } + // if we loose focus, we HAVE to note off all running notes because // we don't receive key-release-events anymore and so the notes would // hang otherwise