diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 64965e128..80758ee4e 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -40,6 +40,8 @@ Changed - The `qt.force_software_rendering` setting changed from a boolean to taking different values (`software-opengl`, `qt-quick` and `chromium`) for different kinds of software rendering workarounds. +- On Qt 5.11, using wayland with QtWebEngine is now possible when using + software rendering. v1.3.2 (unreleased) ------------------- diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index 80b8a710b..b2d6f71bb 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -213,33 +213,41 @@ def _handle_wayland(): if platform not in ['wayland', 'wayland-egl']: return + has_qt511 = qtutils.version_check('5.11', compiled=False) + if has_qt511 and config.val.qt.force_software_rendering == 'chromium': + return + + buttons = [] + text = "
You can work around this in one of the following ways:
" + if 'DISPLAY' in os.environ: # XWayland is available, but QT_QPA_PLATFORM=wayland is set - button = _Button("Force XWayland", 'qt.force_platform', 'xcb') - _show_dialog( - backend=usertypes.Backend.QtWebEngine, - because="you're using Wayland", - text="There are two ways to fix this:
" - "Force Qt to use XWayland
" + buttons.append(_Button("Force XWayland", 'qt.force_platform', 'xcb')) + text += ("Force Qt to use XWayland
" "This allows you to use the newer QtWebEngine backend " "(based on Chromium). " "This sets the qt.force_platform = 'xcb' option " "(if you have a config.py file, you'll need to set " - "this manually).
", - buttons=[button], - ) + "this manually).") else: - # XWayland is unavailable - _show_dialog( - backend=usertypes.Backend.QtWebEngine, - because="you're using Wayland without XWayland", - text="There are two ways to fix this:
" - "Set up XWayland
" - "This allows you to use the newer QtWebEngine backend " - "(based on Chromium). " - ) + text.append("
Set up XWayland
" + "This allows you to use the newer QtWebEngine backend " + "(based on Chromium). ") - raise utils.Unreachable + if has_qt511: + buttons.append(_Button("Force software rendering", + 'qt.force_software_rendering', + 'chromium')) + text += ("
Forcing software rendering
" + "This allows you to use the newer QtWebEngine backend " + "(based on Chromium) but could have noticeable performance " + "impact (depending on your hardware). This sets the " + "qt.force_software_rendering = 'chromium' option " + "(if you have a config.py file, you'll need to set " + "this manually).
") + + _show_dialog(backend=usertypes.Backend.QtWebEngine, + because="you're using Wayland", text=text, buttons=buttons) @attr.s