wasm: Fix secondary thread event processing
Fix test failure in WasmEventDispatcherTest::postEventSecondaryThread()
Revert to using qGlobalPostedEventsCount() for determining
pending events state, but move the final check to after
sending posted events. Also remove a superfluous check.
This partially reverts/amends cc60d706.
Task-number: QTBUG-109066
Pick-to: 6.5
Change-Id: If4f437ce9379282c3d60b0272845a975794883de
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
bb10
parent
16d0e59ea0
commit
daba0b8c19
|
|
@ -209,7 +209,7 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||
{
|
||||
emit awake();
|
||||
|
||||
bool hasPendingEvents = hasWindowSystemEvents();
|
||||
bool hasPendingEvents = qGlobalPostedEventsCount() > 0;
|
||||
|
||||
qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags
|
||||
<< "pending events" << hasPendingEvents;
|
||||
|
|
@ -234,10 +234,10 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||
processTimers();
|
||||
}
|
||||
|
||||
hasPendingEvents = hasWindowSystemEvents();
|
||||
QCoreApplication::sendPostedEvents();
|
||||
processWindowSystemEvents(flags);
|
||||
return hasPendingEvents;
|
||||
|
||||
return qGlobalPostedEventsCount() > 0;
|
||||
}
|
||||
|
||||
void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
|
||||
|
|
@ -245,10 +245,6 @@ void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFl
|
|||
Q_UNUSED(flags);
|
||||
}
|
||||
|
||||
bool QEventDispatcherWasm::hasWindowSystemEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void QEventDispatcherWasm::registerSocketNotifier(QSocketNotifier *notifier)
|
||||
{
|
||||
LOCK_GUARD(g_staticDataMutex);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public:
|
|||
static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite,
|
||||
bool *selectForRead, bool *selectForWrite, bool *socketDisconnect);
|
||||
protected:
|
||||
virtual bool hasWindowSystemEvents();
|
||||
virtual void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -14,8 +14,4 @@ void QWasmEventDispatcher::processWindowSystemEvents(QEventLoop::ProcessEventsFl
|
|||
QWindowSystemInterface::sendWindowSystemEvents(flags);
|
||||
}
|
||||
|
||||
bool QWasmEventDispatcher::hasWindowSystemEvents() {
|
||||
return QWindowSystemInterface::windowSystemEventsQueued();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ class QWasmEventDispatcher : public QEventDispatcherWasm
|
|||
{
|
||||
protected:
|
||||
void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags) override;
|
||||
bool hasWindowSystemEvents() override;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue