From 465b743fd32bd431f2f69fc13a060d4e73f34fa9 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 18 May 2016 10:08:46 -0400 Subject: [PATCH] Bug1365: Do not confuse Linux key event handling... ... So click on QP during scrub had to be implemented without relying on SafeYield() when stopping play. --- src/AudioIO.cpp | 4 +--- src/widgets/Ruler.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index e04f13db4..5687be309 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -2293,9 +2293,7 @@ void AudioIO::StopStream() while( mAudioThreadShouldCallFillBuffersOnce == true ) { // LLL: Experienced recursive yield here...once. - // PRL: Made it safe yield to avoid a certain recursive event processing in the - // time ruler when switching from scrub to quick play. - wxGetApp().SafeYield(nullptr, true); // Pass true for onlyIfNeeded to avoid recursive call error. + wxGetApp().Yield(true); // Pass true for onlyIfNeeded to avoid recursive call error. if (mScrubQueue) mScrubQueue->Nudge(); wxMilliSleep( 50 ); diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 43e1cedf2..d8fdf62fb 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -2404,12 +2404,19 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) ; else if (zone == StatusChoice::EnteringQP && mQuickPlayEnabled && - evt.LeftDown()) { + evt.LeftUp()) { // Stop scrubbing if (HasCapture()) ReleaseMouse(); mProject->OnStop(); - // Continue to quick play event handling + + // Simulate a new click in the same place + evt.SetEventType(wxEVT_LEFT_DOWN); + this->AddPendingEvent(evt); + evt.SetEventType(wxEVT_LEFT_UP); + this->AddPendingEvent(evt); + + return; } else { // If already clicked for scrub, preempt the usual event handling,