mirror of https://github.com/mgba-emu/mgba.git
Qt: Don't attempt to draw a frame if holding an interrupter
This commit is contained in:
parent
fa5c5e9601
commit
2700bf2c97
|
@ -1358,3 +1358,7 @@ void CoreController::Interrupter::resume(CoreController* controller) {
|
||||||
|
|
||||||
mCoreThreadContinue(controller->thread());
|
mCoreThreadContinue(controller->thread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CoreController::Interrupter::held() const {
|
||||||
|
return m_parent && m_parent->thread()->impl;
|
||||||
|
}
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
void interrupt(std::shared_ptr<CoreController>);
|
void interrupt(std::shared_ptr<CoreController>);
|
||||||
void resume();
|
void resume();
|
||||||
|
|
||||||
|
bool held() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void interrupt();
|
void interrupt();
|
||||||
void resume(CoreController*);
|
void resume(CoreController*);
|
||||||
|
|
|
@ -626,6 +626,15 @@ void PainterGL::draw() {
|
||||||
if (!m_started || m_queue.isEmpty()) {
|
if (!m_started || m_queue.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_interrupter.held()) {
|
||||||
|
// A resize event is pending; that needs to happen first
|
||||||
|
if (!m_drawTimer.isActive()) {
|
||||||
|
m_drawTimer.start(0);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mCoreSync* sync = &m_context->thread()->impl->sync;
|
mCoreSync* sync = &m_context->thread()->impl->sync;
|
||||||
if (!mCoreSyncWaitFrameStart(sync)) {
|
if (!mCoreSyncWaitFrameStart(sync)) {
|
||||||
mCoreSyncWaitFrameEnd(sync);
|
mCoreSyncWaitFrameEnd(sync);
|
||||||
|
|
Loading…
Reference in New Issue