Fix checks for Nouveau workaround

This commit is contained in:
Florian Bruhin 2018-07-19 00:28:12 +02:00
parent 1d9ee2c11d
commit 8a748741ba
3 changed files with 14 additions and 1 deletions

View File

@ -89,6 +89,8 @@ def _init_envvars():
os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1'
elif software_rendering == 'qt-quick':
os.environ['QT_QUICK_BACKEND'] = 'software'
elif software_rendering == 'chromium':
os.environ['QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND'] = '1'
if config.val.qt.force_platform is not None:
os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform

View File

@ -172,6 +172,11 @@ def _nvidia_shader_workaround():
def _handle_nouveau_graphics():
"""Force software rendering when using the Nouveau driver.
WORKAROUND for https://bugreports.qt.io/browse/QTBUG-41242
Should be fixed in Qt 5.10 via https://codereview.qt-project.org/#/c/208664/
"""
assert objects.backend == usertypes.Backend.QtWebEngine, objects.backend
if os.environ.get('QUTE_SKIP_NOUVEAU_CHECK'):
@ -181,7 +186,11 @@ def _handle_nouveau_graphics():
return
if (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or
'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ):
# qt.force_software_rendering = 'software-opengl'
'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ or
# qt.force_software_rendering = 'chromium', also see:
# https://build.opensuse.org/package/view_file/openSUSE:Factory/libqt5-qtwebengine/disable-gpu-when-using-nouveau-boo-1005323.diff?expand=1
'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND' in os.environ):
return
button = _Button("Force software rendering", 'qt.force_software_rendering',

View File

@ -293,6 +293,8 @@ class TestEarlyInit:
'QT_XCB_FORCE_SOFTWARE_OPENGL', '1'),
('qt.force_software_rendering', 'qt-quick',
'QT_QUICK_BACKEND', 'software'),
('qt.force_software_rendering', 'chromium',
'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND', '1'),
('qt.force_platform', 'toaster', 'QT_QPA_PLATFORM', 'toaster'),
('qt.highdpi', True, 'QT_AUTO_SCREEN_SCALE_FACTOR', '1'),
('window.hide_decoration', True,