Qt: Disable updates on xcb too

This commit is contained in:
Vicki Pfau 2022-08-13 03:36:03 -07:00
parent 3602bb113e
commit 3b5fb57013
2 changed files with 13 additions and 2 deletions

View File

@ -218,7 +218,7 @@ void DisplayGL::startDrawing(std::shared_ptr<CoreController> controller) {
CoreController::Interrupter interrupter(controller);
QMetaObject::invokeMethod(m_painter.get(), "start");
if (!m_gl) {
if (QGuiApplication::platformName() == "windows") {
if (shouldDisableUpdates()) {
setUpdatesEnabled(false);
}
} else {
@ -306,7 +306,7 @@ void DisplayGL::unpauseDrawing() {
if (m_hasStarted) {
m_isDrawing = true;
QMetaObject::invokeMethod(m_painter.get(), "unpause", Qt::BlockingQueuedConnection);
if (!m_gl && QGuiApplication::platformName() == "windows") {
if (!m_gl && shouldDisableUpdates()) {
setUpdatesEnabled(false);
}
}
@ -385,6 +385,16 @@ void DisplayGL::resizePainter() {
}
}
bool DisplayGL::shouldDisableUpdates() {
if (QGuiApplication::platformName() == "windows") {
return true;
}
if (QGuiApplication::platformName() == "xcb") {
return true;
}
return false;
}
void DisplayGL::setVideoProxy(std::shared_ptr<VideoProxy> proxy) {
Display::setVideoProxy(proxy);
if (proxy) {

View File

@ -112,6 +112,7 @@ protected:
private:
void resizePainter();
bool shouldDisableUpdates();
static QHash<QSurfaceFormat, bool> s_supports;