[platforms/x11][5.12] Force QtQuick to Use Software Rendering on PRIME Systems
Needs ReviewPublic

Authored by ekurzinger on Jun 19 2019, 3:20 PM.


Group Reviewers

Bug 406180 was fixed in Plasma 5.16 and later by commit
0124b1ef191fcafe0d0f89287be66b36833586e6, which
disables vsync for QtQuick windows. However, a bug
in Qt prevents this fix from taking effect for any release
prior to this commit

As a workaround for users stuck with an older Qt version,
this change detects whether PRIME synchronization is
enabled for any output, and if so, forces QtQuick to use
software rendering.

BUG: 406180

Test Plan

On a hybrid graphics system, using the proprietary NVIDIA driver
with PRIME synchronization enabled, perform any action
causing KWin to create a QtQuick window, such as triggering
the alt + tab application switcher.

The desktop should not freeze, even if the Qt version in
use does not include the above commit.

Diff Detail

R108 KWin
Lint Skipped
Unit Tests Skipped
ekurzinger created this revision.Jun 19 2019, 3:20 PM
Restricted Application added a subscriber: kwin. · View Herald TranscriptJun 19 2019, 3:20 PM
ekurzinger requested review of this revision.Jun 19 2019, 3:20 PM

This might serve as a preferable alternative to reverting the tearing fix 22a441e071515e9c630f3bdac743c678052f88be for 5.12.

apol added a subscriber: apol.Jun 20 2019, 10:38 AM
apol added inline comments.

It's usually advised to use qputenv within Qt applications:

Use QQuickWindow::setSceneGraphBackend instead of touching environment variables

ekurzinger updated this revision to Diff 60169.Jun 20 2019, 8:52 PM

Use QQuickWindow::setSceneGraphBackend instead of setting environment variable