From b8f71efc04c10ca3fffda676aaa4c8556cd4a484 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 23 Jan 2019 11:55:56 +0000 Subject: [PATCH] Implement filtering in wxEventLoop::DoYieldFor under wxQT --- src/qt/evtloop.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 132d6533c2..d15ec1ed10 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -131,10 +131,17 @@ void wxQtEventLoopBase::WakeUp() void wxQtEventLoopBase::DoYieldFor(long eventsToProcess) { - while (wxTheApp && wxTheApp->Pending()) - // TODO: implement event filtering using the eventsToProcess mask - wxTheApp->Dispatch(); + QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents; + + if ( !(eventsToProcess & wxEVT_CATEGORY_USER_INPUT) ) + flags |= QEventLoop::ExcludeUserInputEvents; + + if ( !(eventsToProcess & wxEVT_CATEGORY_SOCKET) ) + flags |= QEventLoop::ExcludeSocketNotifiers; + + m_qtEventLoop->processEvents(flags); + wxEventLoopBase::DoYieldFor(eventsToProcess); }