wayland: Also force qtquick to use OpenGL when using OpenGL compositing

Ideally they should match. If kwin uses software renderer, qtquick should
too. If kwin uses OpenGL, then qtquick should a hardware accelerated
graphics api too.
This commit is contained in:
Vlad Zahorodnii 2023-12-21 15:48:20 +02:00
parent 92bbfbc233
commit 647790b44c

View file

@ -175,9 +175,15 @@ void WaylandCompositor::start()
if (m_selectedCompositor == NoCompositing) {
m_selectedCompositor = m_backend->compositingType();
// Force qtquick to software rendering if kwin uses software rendering too.
if (m_selectedCompositor == QPainterCompositing) {
switch (m_selectedCompositor) {
case NoCompositing:
break;
case OpenGLCompositing:
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
break;
case QPainterCompositing:
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
break;
}
}