[+] IIOProcessor::ConfigureNoDeferredTicks (hack for Qt modals)
This commit is contained in:
parent
b411c710d1
commit
2b777f1e38
@ -156,6 +156,11 @@ namespace Aurora::IO
|
||||
* @brief resets the io processors footprint in ::ToQueue()
|
||||
*/
|
||||
virtual void ReleaseAllWatches () = 0;
|
||||
|
||||
/**
|
||||
* @warning: do not use me. this is a niche hack for nested ui modal loops.
|
||||
*/
|
||||
virtual bool ConfigureNoDeferredTicks(bool bOption) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -134,7 +134,8 @@ namespace Aurora::IO
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (this->bFrameStart)
|
||||
if (this->bFrameStart &&
|
||||
!this->bNoDeferredTick)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -510,14 +511,14 @@ namespace Aurora::IO
|
||||
|
||||
bool IOProcessor::AddEventListener(const AuSPtr<IIOProcessorEventListener> &eventListener)
|
||||
{
|
||||
AU_LOCK_GUARD(this->listenersSpinLock);
|
||||
AU_LOCK_GUARD(this->listenersSpinLock->AsWritable());
|
||||
|
||||
return AuTryInsert(this->listeners, eventListener);
|
||||
}
|
||||
|
||||
void IOProcessor::RemoveEventListener(const AuSPtr<IIOProcessorEventListener> &eventListener)
|
||||
{
|
||||
AU_LOCK_GUARD(this->listenersSpinLock);
|
||||
AU_LOCK_GUARD(this->listenersSpinLock->AsWritable());
|
||||
|
||||
AuTryRemove(this->listeners, eventListener);
|
||||
}
|
||||
@ -845,6 +846,11 @@ namespace Aurora::IO
|
||||
return this->pLoopQueue;
|
||||
}
|
||||
|
||||
bool IOProcessor::ConfigureNoDeferredTicks(bool bOption)
|
||||
{
|
||||
return AuExchange(this->bNoDeferredTick, bOption);
|
||||
}
|
||||
|
||||
void IOProcessor::ReleaseAllWatches()
|
||||
{
|
||||
RemoveTimer();
|
||||
@ -874,7 +880,7 @@ namespace Aurora::IO
|
||||
|
||||
void IOProcessor::ReportState(EIOProcessorEventStage stage)
|
||||
{
|
||||
AU_LOCK_GUARD(this->listenersSpinLock);
|
||||
AU_LOCK_GUARD(this->listenersSpinLock->AsReadable());
|
||||
|
||||
for (auto &listeners : this->listeners)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace Aurora::IO
|
||||
bool TickForRegister(const AuSPtr<IIOProcessorItem> &ioEvent);
|
||||
|
||||
void TickForHack(const AuSPtr<IIOProcessorItem> &ioEvent);
|
||||
bool bScheduled_ {};
|
||||
|
||||
AuUInt32 ManualTick() override;
|
||||
|
||||
void DispatchFrame(ProcessInfo &info) override;
|
||||
@ -80,6 +80,8 @@ namespace Aurora::IO
|
||||
AuSPtr<AuLoop::ILoopQueue> ToQueue() override;
|
||||
void ReleaseAllWatches() override;
|
||||
|
||||
bool ConfigureNoDeferredTicks(bool bOption);
|
||||
|
||||
bool HasItems() override;
|
||||
|
||||
void WakeupThread();
|
||||
@ -88,14 +90,6 @@ namespace Aurora::IO
|
||||
|
||||
bool RequestRemovalForItemFromAnyThread(const AuSPtr<IIOProcessorItem> &processor);
|
||||
|
||||
AuSPtr<AuLoop::ILoopQueue> pLoopQueue;
|
||||
|
||||
AuUInt threadId;
|
||||
|
||||
AuUInt64 refreshRateNs {};
|
||||
AuUInt64 minFrameDeltaNs {};
|
||||
bool bIsNoQueue;
|
||||
|
||||
void UpdateTimers();
|
||||
|
||||
void AddTimer();
|
||||
@ -118,13 +112,22 @@ namespace Aurora::IO
|
||||
|
||||
AuThreadPrimitives::MutexUnique_t mutex;
|
||||
|
||||
AuThreadPrimitives::SpinLock listenersSpinLock;
|
||||
AuThreadPrimitives::RWLock listenersSpinLock;
|
||||
AuList<AuSPtr<IIOProcessorEventListener>> listeners;
|
||||
|
||||
AuList<AuSPtr<IIOProcessorWorkUnit>> workUnits;
|
||||
|
||||
IOPipeProcessor streamProcessors;
|
||||
|
||||
AuSPtr<AuLoop::ILoopQueue> pLoopQueue;
|
||||
|
||||
|
||||
AuUInt threadId {};
|
||||
AuUInt64 refreshRateNs {};
|
||||
AuUInt64 minFrameDeltaNs {};
|
||||
bool bIsNoQueue {};
|
||||
bool bFrameStart {};
|
||||
bool bScheduled_ {};
|
||||
bool bNoDeferredTick {};
|
||||
};
|
||||
}
|
@ -67,9 +67,11 @@ namespace Aurora::IO
|
||||
{
|
||||
if (!this->pParent->IsTickOnly())
|
||||
{
|
||||
if (!this->pParent->bFrameStart)
|
||||
bool bForceTick {};
|
||||
if (!this->pParent->bFrameStart ||
|
||||
(bForceTick = this->pParent->bNoDeferredTick))
|
||||
{
|
||||
if (force)
|
||||
if (force || bForceTick)
|
||||
{
|
||||
this->pParent->TickFor(AuSharedFromThis());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user