Force software rendering earlier

We need to do this before a QApplication exists
This commit is contained in:
Florian Bruhin 2017-09-28 09:52:56 +02:00
parent 35beb84e85
commit 6770a474c4
2 changed files with 5 additions and 6 deletions

View File

@ -70,6 +70,10 @@ def early_init(args):
objects.backend = get_backend(args)
if (objects.backend == usertypes.Backend.QtWebEngine and
config.val.force_software_rendering):
os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1'
def get_backend(args):
"""Find out what backend to use based on available libraries."""

View File

@ -139,17 +139,12 @@ def _show_dialog(*args, **kwargs):
def _handle_nouveau_graphics():
assert objects.backend == usertypes.Backend.QtWebEngine, objects.backend
force_sw_var = 'QT_XCB_FORCE_SOFTWARE_OPENGL'
if version.opengl_vendor() != 'nouveau':
return
if (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or
force_sw_var in os.environ):
return
if config.val.force_software_rendering:
os.environ[force_sw_var] = '1'
'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ):
return
button = _Button("Force software rendering", 'force_software_rendering',