mirror of
https://github.com/libretro/mgba.git
synced 2024-11-23 16:10:01 +00:00
Qt: Fix some Qt display driver race conditions
This commit is contained in:
parent
6562e1cfec
commit
e6f34e01f1
1
CHANGES
1
CHANGES
@ -37,6 +37,7 @@ Other fixes:
|
||||
- Qt: Fix adjusting magnification in tile viewer when not fitting to window
|
||||
- FFmpeg: Improve initialization reliability and cleanup
|
||||
- Wii: Fix aspect ratio (fixes mgba.io/i/500)
|
||||
- Qt: Fix some Qt display driver race conditions
|
||||
Misc:
|
||||
- GBA Savedata: EEPROM performance fixes
|
||||
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
|
||||
|
@ -37,6 +37,7 @@ DisplayGL::DisplayGL(const QGLFormat& format, QWidget* parent)
|
||||
m_painter = new PainterGL(format.majorVersion() < 2 ? 1 : m_gl->format().majorVersion(), m_gl);
|
||||
m_gl->setMouseTracking(true);
|
||||
m_gl->setAttribute(Qt::WA_TransparentForMouseEvents); // This doesn't seem to work?
|
||||
setUpdatesEnabled(false); // Prevent paint events, which can cause race conditions
|
||||
}
|
||||
|
||||
DisplayGL::~DisplayGL() {
|
||||
@ -219,6 +220,9 @@ PainterGL::PainterGL(int majorVersion, QGLWidget* parent)
|
||||
#endif
|
||||
m_backend->swap = [](VideoBackend* v) {
|
||||
PainterGL* painter = static_cast<PainterGL*>(v->user);
|
||||
if (!painter->m_gl->isVisible()) {
|
||||
return;
|
||||
}
|
||||
painter->m_gl->swapBuffers();
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
EmptyGLWidget(const QGLFormat& format, QWidget* parent) : QGLWidget(format, parent) { setAutoBufferSwap(false); }
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*) override {}
|
||||
void paintEvent(QPaintEvent* event) override { event->ignore(); }
|
||||
void resizeEvent(QResizeEvent*) override {}
|
||||
void mouseMoveEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user