Allow to force software rendering with wayland on Qt 5.11

Closes #2932 (hopefully for the last time)
This commit is contained in:
Florian Bruhin 2018-06-09 16:50:48 +02:00
parent 88f2873a79
commit 6e954a1596
2 changed files with 29 additions and 19 deletions

View File

@ -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)
-------------------

View File

@ -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 = "<p>You can work around this in one of the following ways:</p>"
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="<p>There are two ways to fix this:</p>"
"<p><b>Force Qt to use XWayland</b></p>"
buttons.append(_Button("Force XWayland", 'qt.force_platform', 'xcb'))
text += ("<p><b>Force Qt to use XWayland</b></p>"
"<p>This allows you to use the newer QtWebEngine backend "
"(based on Chromium). "
"This sets the <i>qt.force_platform = 'xcb'</i> option "
"(if you have a <i>config.py</i> file, you'll need to set "
"this manually).</p>",
buttons=[button],
)
"this manually).</p>")
else:
# XWayland is unavailable
_show_dialog(
backend=usertypes.Backend.QtWebEngine,
because="you're using Wayland without XWayland",
text="<p>There are two ways to fix this:</p>"
"<p><b>Set up XWayland</b></p>"
"<p>This allows you to use the newer QtWebEngine backend "
"(based on Chromium). "
)
text.append("<p><b>Set up XWayland</b></p>"
"<p>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 += ("<p><b>Forcing software rendering</b></p>"
"<p>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 "
"<i>qt.force_software_rendering = 'chromium'</i> option "
"(if you have a <i>config.py</i> file, you'll need to set "
"this manually).</p>")
_show_dialog(backend=usertypes.Backend.QtWebEngine,
because="you're using Wayland", text=text, buttons=buttons)
@attr.s