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>
This commit is contained in:
parent
16d0e59ea0
commit
daba0b8c19
@ -209,7 +209,7 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||||||
{
|
{
|
||||||
emit awake();
|
emit awake();
|
||||||
|
|
||||||
bool hasPendingEvents = hasWindowSystemEvents();
|
bool hasPendingEvents = qGlobalPostedEventsCount() > 0;
|
||||||
|
|
||||||
qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags
|
qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags
|
||||||
<< "pending events" << hasPendingEvents;
|
<< "pending events" << hasPendingEvents;
|
||||||
@ -234,10 +234,10 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||||||
processTimers();
|
processTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
hasPendingEvents = hasWindowSystemEvents();
|
|
||||||
QCoreApplication::sendPostedEvents();
|
QCoreApplication::sendPostedEvents();
|
||||||
processWindowSystemEvents(flags);
|
processWindowSystemEvents(flags);
|
||||||
return hasPendingEvents;
|
|
||||||
|
return qGlobalPostedEventsCount() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
|
void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
|
||||||
@ -245,10 +245,6 @@ void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFl
|
|||||||
Q_UNUSED(flags);
|
Q_UNUSED(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QEventDispatcherWasm::hasWindowSystemEvents() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QEventDispatcherWasm::registerSocketNotifier(QSocketNotifier *notifier)
|
void QEventDispatcherWasm::registerSocketNotifier(QSocketNotifier *notifier)
|
||||||
{
|
{
|
||||||
LOCK_GUARD(g_staticDataMutex);
|
LOCK_GUARD(g_staticDataMutex);
|
||||||
|
@ -53,7 +53,6 @@ public:
|
|||||||
static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite,
|
static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite,
|
||||||
bool *selectForRead, bool *selectForWrite, bool *socketDisconnect);
|
bool *selectForRead, bool *selectForWrite, bool *socketDisconnect);
|
||||||
protected:
|
protected:
|
||||||
virtual bool hasWindowSystemEvents();
|
|
||||||
virtual void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
|
virtual void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -14,8 +14,4 @@ void QWasmEventDispatcher::processWindowSystemEvents(QEventLoop::ProcessEventsFl
|
|||||||
QWindowSystemInterface::sendWindowSystemEvents(flags);
|
QWindowSystemInterface::sendWindowSystemEvents(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWasmEventDispatcher::hasWindowSystemEvents() {
|
|
||||||
return QWindowSystemInterface::windowSystemEventsQueued();
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -12,7 +12,6 @@ class QWasmEventDispatcher : public QEventDispatcherWasm
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags) override;
|
void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags) override;
|
||||||
bool hasWindowSystemEvents() override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user