From anonymous, 3 Months ago, written in Diff-output.
Embed
  1. diff --git a/qutebrowser/config/configinit.py b/qutebrowser/config/configinit.py
  2. index c4418a17c..99a3ff91c 100644
  3. --- a/qutebrowser/config/configinit.py
  4. +++ b/qutebrowser/config/configinit.py
  5. @@ -89,6 +89,8 @@ def _init_envvars():
  6.              os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1'
  7.          elif software_rendering == 'qt-quick':
  8.              os.environ['QT_QUICK_BACKEND'] = 'software'
  9. +        elif software_rendering == 'chromium':
  10. +            os.environ['QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND'] = '1'
  11.  
  12.      if config.val.qt.force_platform is not None:
  13.          os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform
  14. diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py
  15. index b2d6f71bb..363f7f23c 100644
  16. --- a/qutebrowser/misc/backendproblem.py
  17. +++ b/qutebrowser/misc/backendproblem.py
  18. @@ -172,6 +172,11 @@ def _nvidia_shader_workaround():
  19.  
  20.  
  21.  def _handle_nouveau_graphics():
  22. +    """Force software rendering when using the Nouveau driver.
  23. +
  24. +    WORKAROUND for https://bugreports.qt.io/browse/QTBUG-41242
  25. +    Should be fixed in Qt 5.10 via https://codereview.qt-project.org/#/c/208664/
  26. +    """
  27.      assert objects.backend == usertypes.Backend.QtWebEngine, objects.backend
  28.  
  29.      if os.environ.get('QUTE_SKIP_NOUVEAU_CHECK'):
  30. @@ -181,7 +186,11 @@ def _handle_nouveau_graphics():
  31.          return
  32.  
  33.      if (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or
  34. -            'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ):
  35. +            # qt.force_software_rendering = 'software-opengl'
  36. +            'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ or
  37. +            # qt.force_software_rendering = 'chromium', also see:
  38. +            # https://build.opensuse.org/package/view_file/openSUSE:Factory/libqt5-qtwebengine/disable-gpu-when-using-nouveau-boo-1005323.diff?expand=1
  39. +            'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND' in os.environ):
  40.          return
  41.  
  42.      button = _Button("Force software rendering", 'qt.force_software_rendering',
  43. diff --git a/tests/unit/config/test_configinit.py b/tests/unit/config/test_configinit.py
  44. index cb32d3761..56f2a3c90 100644
  45. --- a/tests/unit/config/test_configinit.py
  46. +++ b/tests/unit/config/test_configinit.py
  47. @@ -293,6 +293,8 @@ class TestEarlyInit:
  48.           'QT_XCB_FORCE_SOFTWARE_OPENGL', '1'),
  49.          ('qt.force_software_rendering', 'qt-quick',
  50.           'QT_QUICK_BACKEND', 'software'),
  51. +        ('qt.force_software_rendering', 'chromium',
  52. +         'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND', '1'),
  53.          ('qt.force_platform', 'toaster', 'QT_QPA_PLATFORM', 'toaster'),
  54.          ('qt.highdpi', True, 'QT_AUTO_SCREEN_SCALE_FACTOR', '1'),
  55.          ('window.hide_decoration', True,
  56.