From 53f6a337bf41a62588c971ba85ad0be1dbfb956f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sun, 5 Nov 2017 11:07:04 +0100 Subject: [PATCH] Force Software QtQuick rendering when starting with QPainter compositor Summary: If KWin/Wayland starts up with the QPainter compositor we force software rendering in QtQuick. It doesn't make sense to try to use the OpenGL renderer as that normally just results in an abort when trying to create the QOpenGLContext. Test Plan: Run KWin with KWIN_COMPOSE=Q, tried to quick tile a window and used Alt+Tab. Worked fine, didn't crash anymore. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D8663 --- composite.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composite.cpp b/composite.cpp index 4d71bb5a5b..9cb2b389e0 100644 --- a/composite.cpp +++ b/composite.cpp @@ -50,6 +50,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -254,6 +255,12 @@ void Compositor::slotCompositingOptionsInitialized() } return; } + + if (!Workspace::self() && m_scene && m_scene->compositingType() == QPainterCompositing) { + // Force Software QtQuick on first startup with QPainter + QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); + } + connect(m_scene, &Scene::resetCompositing, this, &Compositor::restart); emit sceneCreated();