Paste P548

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Feb 27 2020, 5:17 PM.
diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp
index d15e50317..f11f6b2f4 100644
--- a/plugins/scenes/opengl/scene_opengl.cpp
+++ b/plugins/scenes/opengl/scene_opengl.cpp
@@ -542,6 +542,8 @@ void SceneOpenGL::handleGraphicsReset(GLenum status)
qCDebug(KWIN_OPENGL) << "Attempting to reset compositing.";
QMetaObject::invokeMethod(this, "resetCompositing", Qt::QueuedConnection);
+ m_degraded = true;
+
KNotification::event(QStringLiteral("graphicsreset"), i18n("Desktop effects were restarted due to a graphics reset"));
}
@@ -616,6 +618,9 @@ void SceneOpenGL2::paintCursor()
qint64 SceneOpenGL::paint(QRegion damage, QList<Toplevel *> toplevels)
{
+ if (m_degraded) {
+ return 0;
+ }
// actually paint the frame, flushed with the NEXT frame
createStackingOrder(toplevels);
diff --git a/plugins/scenes/opengl/scene_opengl.h b/plugins/scenes/opengl/scene_opengl.h
index e1a403631..45f5b52b9 100644
--- a/plugins/scenes/opengl/scene_opengl.h
+++ b/plugins/scenes/opengl/scene_opengl.h
@@ -102,6 +102,7 @@ private:
bool viewportLimitsMatched(const QSize &size) const;
private:
bool m_debug;
+ bool m_degraded = false;
OpenGLBackend *m_backend;
SyncManager *m_syncManager;
SyncObject *m_currentFence;
davidedmundson edited the content of this paste. (Show Details)Feb 27 2020, 5:17 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.