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
This commit is contained in:
Martin Flöser 2017-11-05 11:07:04 +01:00
parent a21b74c05a
commit 53f6a337bf

View file

@ -50,6 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QTimerEvent>
#include <QDateTime>
#include <QOpenGLContext>
#include <QQuickWindow>
#include <KGlobalAccel>
#include <KLocalizedString>
#include <KPluginLoader>
@ -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();